Add Patch Repository
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 3m2s
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 3m2s
This commit is contained in:
parent
78b0b1c52a
commit
9366a69370
@ -42,40 +42,38 @@ namespace Models.Repositories
|
|||||||
.Include(c => c.Accounttypes)
|
.Include(c => c.Accounttypes)
|
||||||
.Include(c => c.PhSCustomerDocuments)
|
.Include(c => c.PhSCustomerDocuments)
|
||||||
.Include(c => c.PhSCustomerAddresses)
|
.Include(c => c.PhSCustomerAddresses)
|
||||||
.Take(100)
|
.Take(3)
|
||||||
.AsQueryable();
|
.AsQueryable();
|
||||||
|
|
||||||
//if (!string.IsNullOrWhiteSpace(name))
|
if (!string.IsNullOrWhiteSpace(name))
|
||||||
//{
|
{
|
||||||
// var loweredName = name.ToLower();
|
var loweredName = name.ToLower();
|
||||||
// query = query.Where(c =>
|
query = query.Where(c =>
|
||||||
// c.Name.ToLower().Contains(loweredName) ||
|
c.Name.ToLower().Contains(loweredName) ||
|
||||||
// c.BusinessName.ToLower().Contains(loweredName));
|
c.BusinessName.ToLower().Contains(loweredName));
|
||||||
//}
|
}
|
||||||
|
|
||||||
//if (!string.IsNullOrWhiteSpace(document))
|
|
||||||
//{
|
|
||||||
// var loweredDoc = document.ToLower();
|
|
||||||
// query = query.Where(c =>
|
|
||||||
// c.PhSCustomerDocuments.Any(a =>
|
|
||||||
// EF.Functions.Like(a.DocumentNumber.ToLower(), $"%{loweredDoc}%")));
|
|
||||||
//}
|
|
||||||
_logger.LogDebug("VALOR RECIBIDO DE 'document': {document}", document);
|
|
||||||
if (!string.IsNullOrWhiteSpace(document) && document != "?")
|
if (!string.IsNullOrWhiteSpace(document) && document != "?")
|
||||||
{
|
{
|
||||||
query = query.Where(c =>
|
query = query.Where(c =>
|
||||||
c.PhSCustomerDocuments.Any(a =>
|
c.PhSCustomerDocuments.Any(a =>
|
||||||
EF.Functions.Like(a.DocumentNumber, $"%{document}%")));
|
EF.Functions.Like(a.DocumentNumber, $"%{document}%")));
|
||||||
}
|
}
|
||||||
//if (!string.IsNullOrWhiteSpace(email))
|
if (!string.IsNullOrWhiteSpace(email))
|
||||||
//{
|
{
|
||||||
// var loweredEmail = email.ToLower();
|
var loweredEmail = email.ToLower();
|
||||||
// query = query.Where(c =>
|
query = query.Where(c =>
|
||||||
// c.PhSCustomerAddresses.Any(a =>
|
c.PhSCustomerAddresses.Any(a =>
|
||||||
// a.Email.ToLower().Contains(loweredEmail)));
|
a.Email.ToLower().Contains(loweredEmail)));
|
||||||
//}
|
}
|
||||||
|
|
||||||
var customers = await query.ToListAsync();
|
var customers = await query.ToListAsync();
|
||||||
|
|
||||||
|
Console.WriteLine("VALOR RECIBIDO DE 'name': {name}", name);
|
||||||
|
Console.WriteLine("VALOR RECIBIDO DE 'document': {document}", document);
|
||||||
|
Console.WriteLine("VALOR RECIBIDO DE 'email': {email}", email);
|
||||||
|
|
||||||
|
|
||||||
return customers.Select(EntityMapper.MapEntity<PhSCustomer, ECustomer>);
|
return customers.Select(EntityMapper.MapEntity<PhSCustomer, ECustomer>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user