Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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(), "" + 
           qsId + "");

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


    predicate = predicate.And(inner);
}       
Comment

PREVIOUS NEXT
Code Example
Csharp :: use string[] args c# 
Csharp :: Get cell value with formatting openxml 
Csharp :: .net framework method 
Csharp :: IEqualityComparer gethashcode strings c# 
Csharp :: how do I write to a csv file from c# using entity framework 
Csharp :: unity soundclip mix 
Csharp :: How to execute a script after the c# function executed 
Csharp :: c# ienumerable unassigned 
Csharp :: 1/1/1/1/1 
Csharp :: ExpandoObject Convert to Json or Json to ExpandoObject 
Csharp :: PasswordBox Helper 
Csharp :: make all variables nonserizlized unity 
Csharp :: c# Jarray tryparse 
Csharp :: WPF combobox filter as you type 
Csharp :: ado .net nullable int datareader 
Csharp :: C# declare object with values 
Csharp :: "; expected" error c#$ 
Csharp :: how to change the volume of all sound effects in monogame 
Csharp :: list of countries in .net mvc 5 
Csharp :: how to disable scale anti-aliasing in monogame 
Csharp :: antlr c# errors 
Csharp :: insert keys automatically dictionary in c# 
Csharp :: c# asp.net gridview selected row unselect 
Csharp :: add new page itext 7 
Csharp :: small index c# 
Csharp :: pun 2 matchmaking custom room properties 
Csharp :: xml reader attributes 
Csharp :: download and run exe c# 1 button 
Csharp :: c# lambda get all records async 
Csharp :: math round to next integer c# 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =