📜  linqkit predicatebuilder or and 嵌套组合谓词 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:31.945000             🧑  作者: Mango

代码示例1
if (!string.IsNullOrEmpty(qsId))
{
    // default false
        var inner = PredicateBuilder.False();

    // 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);
}