I'm getting data for my application through WCF service. And on the server side the service is using EF4.1 as a data access. Service method looks kind of like this :
public List<JobOffer> GetAllJobOffers()
{
var allJobOffers = _jobOffersRepository.GetAll().ToList();
return allJobOffers;
}
And the repository is done this way
public override IQueryable<JobOffer>GetAll()
{
return _context.JobOffers.Include(c => c.Company);
}
I am getting this strange error :
An error occurred while receiving the HTTP response to http://localhost:8080/JobsService/ws. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
In debug mode after hitting F5 it starts to loop forever.
In my case it should some problem with lazy loading on the server side. Because when I am calling the service to return objects with simple structure it works like a champ. What could be messed up? And what is the best practice to eager load objects with EF ?