【发布时间】:2018-09-14 07:04:16
【问题描述】:
我有这个 SQL 查询:
select *
from press
where compId = 36
and categories in (1, 7, 21);
我尝试以 ASP.NET MVC 存储库模式的格式应用它:
iPressRepository.GetAll().Where(x => (x.compId == 36)).ToList();
但我的结果不正确,因为我在第二个查询中错过了“in”类别。有没有办法将IN 运算符与存储库模式一起应用?
提前致谢
【问题讨论】:
标签: c# sql repository-pattern