Add Log Mark DOCLUMENT
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 3m3s
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 3m3s
This commit is contained in:
parent
7777cd365f
commit
d5f71510a9
@ -1,5 +1,6 @@
|
|||||||
using Domain.Entities;
|
using Domain.Entities;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using Models.Helpers;
|
using Models.Helpers;
|
||||||
using Models.Interfaces;
|
using Models.Interfaces;
|
||||||
using Models.Models;
|
using Models.Models;
|
||||||
@ -7,10 +8,12 @@ using System.Xml.Linq;
|
|||||||
|
|
||||||
namespace Models.Repositories
|
namespace Models.Repositories
|
||||||
{
|
{
|
||||||
public class PhSCustomerRepository(PhronCareOperationsHubContext context) : IPhSCustomerRepository
|
public class PhSCustomerRepository(PhronCareOperationsHubContext context, ILogger<PhSCustomerRepository> logger) : IPhSCustomerRepository
|
||||||
{
|
{
|
||||||
#region Declaraciones y Constructor
|
#region Declaraciones y Constructor
|
||||||
private readonly PhronCareOperationsHubContext _context = context;
|
private readonly PhronCareOperationsHubContext _context = context;
|
||||||
|
private readonly ILogger<PhSCustomerRepository> _logger = logger;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public async Task<IEnumerable<ECustomer>> GetAllAsync()
|
public async Task<IEnumerable<ECustomer>> GetAllAsync()
|
||||||
{
|
{
|
||||||
@ -56,12 +59,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(document))
|
_logger.LogDebug("VALOR RECIBIDO DE 'document': {document}", document);
|
||||||
|
if (!string.IsNullOrWhiteSpace(document) && document != "?")
|
||||||
{
|
{
|
||||||
var loweredDoc = document.ToLower();
|
var loweredDoc = document.ToLower();
|
||||||
query = query.Where(c =>
|
query = query.Where(c =>
|
||||||
c.PhSCustomerDocuments.Any(a =>
|
c.PhSCustomerDocuments.Any(a =>
|
||||||
a.DocumentNumber.ToLower().Contains(loweredDoc)));
|
EF.Functions.Like(a.DocumentNumber.ToLower(), $"%{loweredDoc}%")));
|
||||||
}
|
}
|
||||||
//if (!string.IsNullOrWhiteSpace(email))
|
//if (!string.IsNullOrWhiteSpace(email))
|
||||||
//{
|
//{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user