Man*_*BAG 0 .net c# linq entity-framework
Select * From Employee where Id in (1, 2, 5, 7)
Run Code Online (Sandbox Code Playgroud)
现在我如何在 LINQ 查询中使用 from where select
var ids = new List<int>() {1, 2, 5, 7}
from employees in _EmployeeRepository.Table
where employees.id *in list*
select employess
Run Code Online (Sandbox Code Playgroud)
如果字符串包含就可以了。如何实现整数列。我知道我缺少非常基本的东西。
小智 6
var ids = new List<int>() {1, 2, 5, 7}
var result = from employee in _EmployeeRepository.Table
where ids.Contains(employee.id)
select employee;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2888 次 |
| 最近记录: |