【发布时间】:2011-10-03 18:06:22
【问题描述】:
我有:
Dictionary<int, List<int>> dict = new ...
var a = SomeEntity.Where(f => dict[f.key].Contains(f.someValue))
这会产生错误
LINQ to Entities does not recognize the method 'System.Collections.Generic.List`1[System.Int32] get_Item(Int32)' method
使用列表时它可以工作:
List<int> l = new ...
var a = SomeEntity.Where(f => l.Contains(f.someValue))
那么这是 linq 对 EF 的限制还是我遗漏了什么?
【问题讨论】:
标签: linq entity-framework