我有一个从数据表发送来的int列表,我需要用这个对象过滤整个列表。
var Ids = new List<int>();
Ids = {2, 4, 5};
var result = (from m in member
join r in role on m.memberId equals r.memberId
where
Ids.Equals(m.memberId) && r.status = 1
select m).ToList();
我很想在单个查询中获得结果。
答案 0 :(得分:0)
我解决了这个问题
var Ids = new List<int>();
Ids = {2, 4, 5};
var result = (from m in member
join r in role on m.memberId equals r.memberId
where
Ids.Any(i=> i == m.memberId) && r.status = 1
select m).ToList();