Question: Two simple queries - the exception occurs in :

```
matchings.Any(u => product.ProductId == u.ProductId)

```

What is wrong? If I write `true` instead it all is good.

```
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();

```

Answer: 
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;

```
You can try the following. It has worked for me as my ProductId os of type nullable.

```
IQueryable<matchings> data = db.matchings.Any(u => product.ProductId.Value == u.ProductId);

```

or this

```
IQueryable<matchings> 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.