views:

109

answers:

2

I want to get all records WHERE (s.override == 1 OR (s.override == 2 AND s.approved == 1))

How can I do that using the .Where x.subcontracts.Where(s ==> ??)

+7  A: 

Use standard C# binary operators:

x.subcontracts
  .Where(s => s.override == 1 || (s.override == 2 && s.approved == 1))
Keltex
+2  A: 

Here is the where clause you need:

x.subcontracts.Where(s => (s.override == 1) || (s.override == 2 && s.approved == 1))
Giorgi