在Entity Framework 4中显示多个连接表 [英] Explicit many to many join table in Entity Framework 4

查看:163
本文介绍了在Entity Framework 4中显示多个连接表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,EF隐藏多个连接表,其中不包含附加数据的连接表。

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

是否可以告诉EF和设计师)明确创建连接表并使其在代码中可用?

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

谢谢

推荐答案

没有EF设计师不会为您添加此实体。如果您想要连接表暴露,您必须手动删除创建的关系并添加连接表的实体和两个一对多的FK关系。以下是有关分步指南的相关问题:

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

这篇关于在Entity Framework 4中显示多个连接表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆