Open Closed

"WhereIf" method of using? #245

ghua created


Can you tell me the filter criteria "WhereIf" how to use it? Can you give me an example?

2 Answer(s)
  • 0
    daws created

    searching on gitHub <a class="postlink" href=""> ... &q=WhereIf</a>

    the third example could maybe help you.

  • 0
    hikalkan created
    Support Team

    Thanks @daws. An example usage for IQueryable<T>:

    var ternants = _tenantRepository.GetAll()
                    .WhereIf(input.GetOnlyActives, t => t.IsActive)
                        t =>
                            t.Name.Contains(input.Filter) ||

    It also works for IEnumerable<T>.