Including navigation properties from Entity Framework TPH classes

做~自己de王妃 提交于 2019-12-03 20:14:00

I would probably use projection for this. Instead of returning entity types, project onto lightweight data transfer objects or anonymous types. When you project (e.g., with a LINQ query), the loading happens automatically. You don't need to specify an Include in this case.

I was just having a similar problem to yours (easier naviagation path) and I realised that the PropertyName in the Designer.cs file was not what I expected. Once I changed it to the PropertyName in the Designer file it all worked fine - also note I did two different paths which became:

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