I have writed linq EF4 query, but it failed with exception The argument to **"DbIsNullExpression must refer to a primitive, enumeration or reference type."** The query written bellow:

```
from listing in ctx.listingSource
join listingFile in ctx.ListingFiles
         .Where(x => companyIds.Contains(x.CompanyID.Value))
         .GroupBy(x => x.ListingID)
         .Select(x => new { ListingId = x.Key, Count = x.Count() }) on listing.ListingID equals listingFile.ListingId into listingFilesJoined
from listingFileJoined in listingFilesJoined.DefaultIfEmpty()
select new ListingDTO
{
    fileCount = listingFileJoined == null ? 0 : listingFileJoined.Count,
}

```

How can I resolve this issue without creating class instead anonymous type ?