我在写一个Linq查询。有没有一种方法可以连接到基于某些条件进行查询?Linq to Entity - 如何连接条件
像查询
from res in _db.Person
where res.Departments.ID == deptId
select res;
而且如果我有真正的一个条件,我想它是这样的
from res in _db.Person
where res.Departments.ID == deptId && res.Departments.Type == deptType
select res;
能否请你澄清你所需要的逻辑,你已经声明你需要或者在另一个评论你需要或? –
使用这种方法http://stackoverflow.com/questions/21512230/where-clause-with-multiple-unknown-conditions –