Explicit many to many join table in Entity Framework 4

二次信任 提交于 2019-12-06 03:32:07

问题


By default EF hides a many to many join table that does not contain additional data than the foreign keys to the joined tables.

Is it possible to tell EF (and the designer) to explicitly create the join table and make it usable in code?

Thanks


回答1:


No EF designer will not add this entity for you. If you want junction table exposed you must manually delete created relation and add junction table's entity and two one-to-many FK relations. Here are related questions with step by step guide:

  • How to expose the join table in many to many relation
  • How to get Entity to Table mapping for many to many relations


来源:https://stackoverflow.com/questions/6070554/explicit-many-to-many-join-table-in-entity-framework-4

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