Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Expression.Or with multiple parameters

$
0
0

Hello,

I want to build a linq/ef expression tree.

I need to make an Or between multiple binaryexpressions.

Expression.Or, Expression.OrElse takes only 2 arguments.

If i combine multiple Expression.Or, a get an sql query with parenthesis like this:

((field1='value1' or field1='value2') or field1='value3) or field1='value4')

How can i generate this sql filter:

field1='value1' or field2='value2' or field1='value3 or field1='value4'

Thanks


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>