OrExpression

OrExpression is one of more than 130 LINQ expressions.

What it is

OrExpression is used to compare boolean values and return the boolean OR result. When one or all booleans are true, the value true will be returned.

See also the AndExpression .

Code examples

The pure LINQ expression looks like this:

if (left == null || right == null)
    return null;

return new OrExpression(left, right);


In the AI-Framework, the AndExpression can simply be written with ||. The AI-Framework will then generated the necessary LINQ expressions.

return (left || right);

 

Explanation of the examples

If two booleans (left and right) are both not null (line 1 first example), the OR of these two booleans is returned (line 4 first example).

The same is done with left || right in the second example.