diff --git a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs index 6574b909e..3f7127274 100644 --- a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs @@ -8,7 +8,7 @@ using IRaCIS.Core.Domain.Models; using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; - +using Castle.Core.Internal; namespace IRaCIS.Core.Application.Service { @@ -27,11 +27,18 @@ namespace IRaCIS.Core.Application.Service } - public async Task> GetFrontAuditConfigList(FrontAuditConfigQuery queryFrontAuditConfig) + public async Task> GetFrontAuditConfigList(FrontAuditConfigQuery iq) { + var query = _repository.GetQueryable() + .WhereIf(!iq.Value.IsNullOrEmpty(), x => x.Value == iq.Value) + .WhereIf(!iq.Value.IsNullOrEmpty(), x => x.ValueCN == iq.ValueCN) + .WhereIf(!iq.Value.IsNullOrEmpty(), x => x.Description == iq.Description) + .WhereIf(!iq.Value.IsNullOrEmpty(), x => x.OptTypeId == iq.OptTypeId) + .WhereIf(!iq.Value.IsNullOrEmpty(), x => x.Code == iq.Code) + .WhereIf(!iq.Value.IsNullOrEmpty(), x => x.ChildrenTypeId == iq.ChildrenTypeId); - var frontAuditConfigQueryable = _repository.GetQueryable() + var frontAuditConfigQueryable = query .ProjectTo(_mapper.ConfigurationProvider); return await frontAuditConfigQueryable.ToListAsync();