简体   繁体   English

实体框架 Collections 和(许多)关系名称

[英]Entity Framework Collections and (many) Relationship Names

When I assign many realtionships from one table to another.当我将一张桌子上的许多房地产分配给另一张桌子时。 For example, table ticket has many columns related to the employees table: one employee started the sale, other employee finished it, and another one will follow post sale.例如,表工单有许多与employees 表相关的列:一位员工开始销售,另一位员工完成,另一位将跟随售后。 Columns start, finish and follow will point to the employees table. start、finish 和 follow 列将指向员工表。

Entity Framework creates the virtual collections as Employee1, Employee2.... in the data model, despite i have named the relationships in MSSQL SMS...实体框架在数据 model 中将虚拟 collections 创建为 Employee1,Employee2 ....,尽管我已经在 MSSQL SMS 中命名了关系...

Is there a way that the collections takes the names of the relationships? collections 有没有办法使用关系的名称?

  • EDIT编辑

I am using code-first, but i am working on an existing database...我正在使用代码优先,但我正在处理现有数据库......

thanks!谢谢!

You can find out about this problem on entityframeworktutorial website., actually it's not mine.您可以在 entityframeworktutorial 网站上找到有关此问题的信息。实际上它不是我的。 but I'd like to share some links about it with you, I know I should doing comment instead of answer.但我想和你分享一些关于它的链接,我知道我应该做评论而不是回答。 but please understand I don't have enough reps (50 rep) to make comment!.但请理解我没有足够的代表(50 代表)发表评论! Configure One-to-Many Relationships 配置一对多关系

Configure Many-to-Many Relationships 配置多对多关系

Keep list of foreign keys in many-to-many Entity Framework relationship | 保持多对多实体框架关系中的外键列表 | StackOverFlow 堆栈溢出

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

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