0
ghua created
Hi~
Can you tell me the filter criteria "WhereIf" how to use it? Can you give me an example?
2 Answer(s)
-
0
searching on gitHub <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/search?utf8=%E2%9C%93&q=WhereIf">https://github.com/aspnetboilerplate/as ... &q=WhereIf</a>
the third example could maybe help you.
-
0
Thanks @daws. An example usage for IQueryable<T>:
var ternants = _tenantRepository.GetAll() .WhereIf(input.GetOnlyActives, t => t.IsActive) .WhereIf( !input.Filter.IsNullOrWhiteSpace(), t => t.Name.Contains(input.Filter) || t.TenancyName.Contains(input.Filter) ) .ToList();
It also works for IEnumerable<T>.