次のようなコードを実行する必要があります。
Dictionary<Int64, List<Int64>> types;
// initialization of dictionary
results = (from m in d.Linq()
where (filter.Types.Any(x =>
x.Key == m.DocumentType.Code
&& x.Value.Contains(m.DocumentPurpose.Code)
)
)
select m
).ToList();
このテストを実行したとき、私は受け取りましSystem.NullReferenceException
た。types
しかし、オブジェクトはそうではなくnull
、少なくとも1つのペア(キー:26、値:2、4)が含まれていると確信しています。
LINQはこのAny()式をSQLに変換できないと思います。このクエリを書き直すにはどうすればよいですか?