4

在 T-SQL 中,我们有

where empid in (1, 3, 5)

现在假设我有一个List<int>,我如何编写一个 LINQ to Entities 查询,即一个谓词Where()以获得与上述 SQL 查询等效的内容?还是根本不支持?

谢谢,

4

1 回答 1

4

尝试这个:

var Products = from product in dbctx.Products
            where itemQuery.Contains(product.ProductID)
            select product;
于 2011-10-27T10:05:19.083 回答