How to write an "OR" within a Linq to Sql .Where()
I want to get all records WHER开发者_StackOverflowE (s.override == 1 OR (s.override == 2 AND s.approved == 1))
How can I do that using the .Where x.subcontracts.Where(s ==> ??)
Use standard C# binary operators:
x.subcontracts
.Where(s => s.override == 1 || (s.override == 2 && s.approved == 1))
Here is the where clause you need:
x.subcontracts.Where(s => (s.override == 1) || (s.override == 2 && s.approved == 1))
精彩评论