here's my code. it works
var someField = "abc";
var list = Entities.Where(x=>SomeField).FirstOrDefault();
here's the problem, someField can also be null or string.empty. If someField is null or string.empty, I will select everything where SomeField is null or string.empty.
var list = Entities.Where(x=>SomeField == null || SomeField == string.empty).FirstOrDefault();
right now, I have an if else statement to check if someField has value,then decided which query to use.
I need to combine the 2 queries into one. because if there are fields we need to check, then this if else statemetn will get very long.
SomeFieldis of typebool. Now it's of typestring? Your question is very unclear.