Two simple queries - the exception occurs in :
matchings.Any(u => product.ProductId == u.ProductId)
What is wrong? If I write true
You can try the following. It has worked for me as my ProductId os of type nullable.
IQueryable data = db.matchings.Any(u => product.ProductId.Value == u.ProductId);
or this
IQueryable data = db.matchings.Any(u => product.ProductId.Value.Equals(u.ProductId));
This worked in my case as the target id is a nullable type as it points to a 1:0 -> * relationship.