Answers for "linqkit predicatebuilder or and nested combined predicates"

0

linqkit predicatebuilder or and nested combined predicates

if (!string.IsNullOrEmpty(qsId))
{
    // default false
        var inner = PredicateBuilder.False<Product>();

    // first or
    inner = inner.Or (i => 
           Regex.IsMatch(i.GetProperty("makeTag").Value.ToString(), "\\b" + 
           qsId + "\\b");

    // second or       
    inner = inner.Or (i => 
        string.IsNullOrEmpty(i.GetProperty("makeTag")).Value.ToString());


    predicate = predicate.And(inner);
}
Posted by: Guest on June-21-2021

Code answers related to "linqkit predicatebuilder or and nested combined predicates"

Browse Popular Code Answers by Language