开发者

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))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜