diff --git a/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs b/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs index 59cce4aa2..b556fd445 100644 --- a/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs @@ -25,10 +25,10 @@ namespace IRaCIS.Core.Application.Service var exploreRecommendQueryable = _exploreRecommendRepository.Where().IgnoreQueryFilters() - .WhereIf(string.IsNullOrEmpty(inQuery.Title), t => t.Title.Contains(inQuery.Title)) - .WhereIf(string.IsNullOrEmpty(inQuery.FileName), t => t.Title.Contains(inQuery.FileName)) - .WhereIf(string.IsNullOrEmpty(inQuery.DownloadUrl), t => t.Title.Contains(inQuery.DownloadUrl)) - .WhereIf(string.IsNullOrEmpty(inQuery.Version), t => t.Title.Contains(inQuery.Version)) + .WhereIf(!string.IsNullOrEmpty(inQuery.Title), t => t.Title.Contains(inQuery.Title)) + .WhereIf(!string.IsNullOrEmpty(inQuery.FileName), t => t.Title.Contains(inQuery.FileName)) + .WhereIf(!string.IsNullOrEmpty(inQuery.DownloadUrl), t => t.Title.Contains(inQuery.DownloadUrl)) + .WhereIf(!string.IsNullOrEmpty(inQuery.Version), t => t.Title.Contains(inQuery.Version)) .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == t.IsDeleted) .ProjectTo(_mapper.ConfigurationProvider); diff --git a/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs b/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs index bc1832680..f76d52f41 100644 --- a/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs +++ b/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs @@ -5,6 +5,7 @@ //-------------------------------------------------------------------- using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Services { @@ -25,7 +26,10 @@ namespace IRaCIS.Core.Application.Services [HttpPost] public async Task> GetSystemBasicDataList(SystemBasicDataQuery inQuery) { - var systemBasicDataQueryable = _systemBasicDataRepository.Where(t => t.ParentId == null) + var systemBasicDataQueryable = _systemBasicDataRepository + .Where(t => t.ParentId == null) + .WhereIf(inQuery.Code != null, t => t.Code.Contains(inQuery.Code)) + .WhereIf(inQuery.Name != null, t => t.Name.Contains(inQuery.Name)) .ProjectTo(_mapper.ConfigurationProvider); return await systemBasicDataQueryable.ToPagedListAsync(inQuery, nameof(SystemBasicDataView.Code));