What does a repository look like when using many 1:Many or Many:Many tables?

假装没事ソ 提交于 2019-12-06 02:59:33

All you should have to do is make sure repository.GetProducts() eagerly loads the appropriate navigation properties.

See the repository in this tutorial, which allows you to specify eager loading for specified navigation properties: http://www.asp.net/entity-framework/tutorials/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application

In most cases the repository is created for each business object. But this raises the problem of object loading which will not be done in case when lazy loading is disabled.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!