Normally when we have a grid result with multiple possible filters we may use a logic similar to this one:
var query = db.Something;
if(isFilter1 != null)
query = query.Where(x=>x.Prop1 == isFilter1);
}
if(isFilter2 != null)
query = query.Where(x=>x.Prop2 == isFilter2);
}
.... etc...
var finalResult = query.ToList();
But now I would like to use this kind of logic but using "OR" and not only "AND". A simple example of the "end result of the query" that I want to achive.
var finalResult = db.Something.Where(x =>
x.Prop1 == null &&
x.Prop2 != 0 &&
x.Prop3 == id &&
(x.Prop4 == "String1" || x.Prop4== "String2" || x.Prop4== "String3"));