Add Log Mark DOCLUMENT
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 3m3s

This commit is contained in:
Leandro Hernan Rojas 2025-04-05 12:54:16 -03:00
parent 7777cd365f
commit d5f71510a9

View File

@ -1,5 +1,6 @@
using Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Models.Helpers;
using Models.Interfaces;
using Models.Models;
@ -7,10 +8,12 @@ using System.Xml.Linq;
namespace Models.Repositories
{
public class PhSCustomerRepository(PhronCareOperationsHubContext context) : IPhSCustomerRepository
public class PhSCustomerRepository(PhronCareOperationsHubContext context, ILogger<PhSCustomerRepository> logger) : IPhSCustomerRepository
{
#region Declaraciones y Constructor
private readonly PhronCareOperationsHubContext _context = context;
private readonly ILogger<PhSCustomerRepository> _logger = logger;
#endregion
public async Task<IEnumerable<ECustomer>> GetAllAsync()
{
@ -56,12 +59,13 @@ namespace Models.Repositories
// c.PhSCustomerDocuments.Any(a =>
// 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();
query = query.Where(c =>
c.PhSCustomerDocuments.Any(a =>
a.DocumentNumber.ToLower().Contains(loweredDoc)));
EF.Functions.Like(a.DocumentNumber.ToLower(), $"%{loweredDoc}%")));
}
//if (!string.IsNullOrWhiteSpace(email))
//{