开发者

Linq.Where( List.Contains(Value) ) does not work on Entities

Code snippet

var list = 
(from item in entitySet.Clients.AsQueryable()
where listOfId.Contains(item.ID.ToString())
select item).ToList();

Error Message

LINQ to Enti开发者_如何学编程ties does not recognize the method 'Boolean Contains(System.String)' method, and this method cannot be translated into a store expression

Any solution to this ?


Try this:

var list = 
(from item in entitySet.Clients
join id in listOfId on item.ID equals id
select item).ToList();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜