How can I use TPT inheritance models when primary keys have different names?

久未见 提交于 2019-11-30 16:25:24
Ladislav Mrnka

I described TPT mapping here. It is step by step so it should work but you need to map Ids in child entities.

But the issue is that you start with Model-first, generate DdContext which is dependent on EDMX, then delete that EDMX and start defining mapping by yourselves. You should decide if you want to use Model-first or Code-first. You just wasted your effort in EDMX.

If you want to know how to use Model-first with DbContext check this article. If you want to use Code-first don't create EDMX and follow this article to map your inheritance.

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