【发布时间】:2018-04-22 21:18:45
【问题描述】:
Select * From Employee where Id in (1, 2, 5, 7)
现在如何使用from where select 在 LINQ 查询中编写此代码
var ids = new List<int>() {1, 2, 5, 7}
from employees in _EmployeeRepository.Table
where employees.id *in list*
select employess
如果字符串包含会做。如何实现整数列。我知道我缺少非常基本的东西。
【问题讨论】:
-
为什么
Contains不适用于整数列? -
在 where 条件下使用 ids.Contains()。
标签: c# .net entity-framework linq