【发布时间】:2011-10-08 02:49:16
【问题描述】:
在我的应用程序中,我遇到了查询问题。
我正在尝试运行具有多个条件值的查询。
IQueryable<DealsDetails> DD = (from D in DbContext.Deals
where lst.Contains(D.DealCategory)
select D);
我有这个查询,lst 将包含以下值:
lst.Add("Other");
lst.Add("Services");
而 D.DealCategory 包含这样的值。
Other,Beauty,Services
Beauty,Services,
Services
Other,
Beauty
Other,Services
我需要包含该列表中任何项目的表中的所有行。表示包含 Other 和 Services 的所有行。
结果是
其他、美容、服务 美容、服务、 服务 其他 其他、服务
不包括美女排。
请建议我如何编写此查询。
首次编辑
我需要 DealCategory 列包含列表中任何项目的所有行。
谢谢
【问题讨论】:
标签: c# linq-to-sql