简体   繁体   中英

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. Columns start, finish and follow will point to the employees table.

Entity Framework creates the virtual collections as Employee1, Employee2.... in the data model, despite i have named the relationships in MSSQL SMS...

Is there a way that the collections takes the names of the relationships?

  • 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. 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!. Configure One-to-Many Relationships

Configure Many-to-Many Relationships

Keep list of foreign keys in many-to-many Entity Framework relationship | StackOverFlow

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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