optimize
wet 2 years ago
parent 59791c5d00
commit 1a199a483f

@ -1584,7 +1584,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
List<CodeCountry> list = await _sysCacheService.GetAllCodeCountry(); List<CodeCountry> list = await _sysCacheService.GetAllCodeCountry();
var queryList = list var queryList = list
.WhereIF(!string.IsNullOrEmpty(input.Name),x=>x.Code==input.Name) .WhereIF(!string.IsNullOrEmpty(input.Name),x=>x.Code.ToUpper()==input.Name.ToUpper())
.WhereIF(!string.IsNullOrEmpty(input.KeyWord), .WhereIF(!string.IsNullOrEmpty(input.KeyWord),
x => (!string.IsNullOrWhiteSpace(x.Code) && x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) x => (!string.IsNullOrWhiteSpace(x.Code) && x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase))
|| (!string.IsNullOrWhiteSpace(x.EnName) && x.EnName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) || (!string.IsNullOrWhiteSpace(x.EnName) && x.EnName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase))

Loading…
Cancel
Save