Two simple queries - the exception occurs in :
matchings.Any(u => product.ProductId == u.ProductId)
What is wrong? If I write true
true
This looks like a place to use join
var query = from product in db.Products join matching in db.Matchings on product.ProductId equals matching.ProductId into matchGroup where matchGroup.Count() > 0 and matching.StoreId == StoreId select product;