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;

```
I was facing the same issue when writing the following query using collection and EF tables:

```
var result = (from listItem in list
              join dbRecord in Context.MY_TABLE
                  on listItem.MyClass.ID equals dbRecord.ID
              select new { dbRecord, listItem.SomeEnum }).ToList();

```

I could solve it by **changing the source order** in `in`:

```
var result = (from dbRecord in Context.MY_TABLE
              join listItem in list
                  on dbRecord.ID equals listItem.MyClass.ID
              select new { dbRecord, listItem.SomeEnum }).ToList();

```