两个简单的查询 - 异常发生在:
matchings.Any(u => product.ProductId == u.ProductId)
怎么了?如果我改写true
,一切都很好。
var matchings = (from match in db.matchings
where match.StoreId == StoreId
select match).ToList();
var names = (from product in db.Products
where matchings.Any(u => product.ProductId == u.ProductId)
select product).ToList();