I am trying to filter out some objects using linq for enitites, and I get an error: "Enumeration did not give any results."
on the client side, I get the following message:
The operation could not be completed because the DbContext was located
I know that these filter values ββshould return some results, but it just doesn't work, so I assume my query is wrong, can you help.
var mediaChannels = NeptuneUnitOfWork.MediaChannels .FindWhere(m => m.CountryID == CountryID && m.SonarMediaTypeID == MediaTypeID && m.SonarMediaTypes.SonarMediaGroupID == MediaGroupID && m.Name.Contains(search)) .Select(m => new MediaChannelModel() { ID = m.ID, Name = m.Name, MediaType = m.MediaType.Name, Country = m.Countries.Name, SubRegion = m.Countries.Lookup_SubRegions.Name, Region = m.Countries.Lookup_SubRegions.Lookup_Regions.Name });
source share