简体   繁体   English

实体框架表映射到没有表的关联

[英]Entity Framework table Mapped to an Association with No Table

I created a table in SQL that just contained 2 foreign keys, Which Linked a single Bulk upload entry to many titles. 我在SQL中创建了一个表,其中仅包含2个外键,该表将单个批量上传条目链接到许多标题。 After updating my edmx model. 更新我的edmx模型之后。

I noticed there is no table in the diagram. 我注意到图中没有表格。
Just an Association mapped between my title table and my bulkupload table. 只是在我的标题表和bulkupload表之间映射的关联。

There is no table in the diagram so I cannot delete the table. 图表中没有表格,因此无法删除该表格。
I cannot add things to the table because there is no connection in the C# Code. 我无法将内容添加到表中,因为C#代码中没有连接。 ' '

Does anybody have information on why this is happening and how I can fix and add this table so its able to add entries to it? 是否有人知道为什么会发生这种情况以及如何修复和添加此表,以便它能够向其中添加条目?

You can leave it as an association if you'd like. 如果愿意,可以将其保留为关联。 To add things to you junction table you add things to your Icollection so in pseducode: 要将内容添加到联结表中,请在pseducode中添加以下内容:

BulkEntry.Titles.add(TitleToAdd)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM