Test Search Customer
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 2m54s
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 2m54s
This commit is contained in:
parent
aa13555427
commit
bed284692c
@ -41,13 +41,13 @@ namespace Models.Repositories
|
|||||||
.Include(c => c.PhSCustomerAddresses)
|
.Include(c => c.PhSCustomerAddresses)
|
||||||
.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))
|
if (!string.IsNullOrWhiteSpace(document))
|
||||||
{
|
{
|
||||||
@ -56,13 +56,13 @@ namespace Models.Repositories
|
|||||||
c.PhSCustomerDocuments.Any(a =>
|
c.PhSCustomerDocuments.Any(a =>
|
||||||
EF.Functions.Like(a.DocumentNumber.ToLower(), $"%{loweredDoc}%")));
|
EF.Functions.Like(a.DocumentNumber.ToLower(), $"%{loweredDoc}%")));
|
||||||
}
|
}
|
||||||
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();
|
||||||
return customers.Select(EntityMapper.MapEntity<PhSCustomer, ECustomer>);
|
return customers.Select(EntityMapper.MapEntity<PhSCustomer, ECustomer>);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user