读书人

select * from student where [id] in

发布时间: 2013-09-07 14:12:44 作者: rapoo

select * from student where [id] in (1,2,3,4)怎么写成linq
select * from student where [id] in (1,2,3,4)怎么写成linq
[解决办法]
linq里没有in 吧,用Contains.
List<int> ids = new List<int>(){1,2,3,4};
var query = from s in student
where ids.Contains(s.id)
select s;

读书人网 >.NET

热点推荐