Naz*_*gol 1 wcf web-services lazy-loading entity-framework-4.1
我通过WCF服务获取应用程序的数据.在服务器端,该服务使用EF4.1作为数据访问.服务方法看起来像这样:
public List<JobOffer> GetAllJobOffers()
{
var allJobOffers = _jobOffersRepository.GetAll().ToList();
return allJobOffers;
}
Run Code Online (Sandbox Code Playgroud)
存储库就是这样完成的
public override IQueryable<JobOffer>GetAll()
{
return _context.JobOffers.Include(c => c.Company);
}
Run Code Online (Sandbox Code Playgroud)
我收到这个奇怪的错误:
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.
在点击F5后的调试模式下,它开始永远循环.
在我的情况下,它应该在服务器端延迟加载一些问题.因为当我调用服务返回具有简单结构的对象时,它就像一个冠军.什么可能搞砸了?使用EF急切加载对象的最佳做法是什么?
| 归档时间: |
|
| 查看次数: |
2816 次 |
| 最近记录: |