I need to check if all definitions contains some specific data. It works fine except the case when GroupBy returns empty collection.
var exist = dbContext.De
Well, you can do it in two steps :
var definitions = definitions.Where( x => propertyTypeIds.Contains(x.PropertyTypeId) && x.CountryId == countryId) .GroupBy(x => x.PropertyTypeId); var exist = definitions.Any() && definitions.All(...some condition...);