我有:
Dictionary<int, List<int>> dict = new ...
var a = SomeEntity.Where(f => dict[f.key].Contains(f.someValue))
Run Code Online (Sandbox Code Playgroud)
这会产生错误
LINQ to Entities does not recognize the method 'System.Collections.Generic.List`1[System.Int32] get_Item(Int32)' method
Run Code Online (Sandbox Code Playgroud)
与列表一起工作:
List<int> l = new ...
var a = SomeEntity.Where(f => l.Contains(f.someValue))
Run Code Online (Sandbox Code Playgroud)
因此linq对EF的这种限制还是我错过了什么?