简体   繁体   中英

One of my tables isn't shown in the model diagram EF5.0 VS 2013 Community

Model Diagram

Hi all! Noobie here, I am using VS 2013 community edition to build an inventory control application and also using Entity Framework 5.0. I have used the database first approach to create the above model.

If i describe the model i have a user table which i have used to save login information. And there are three tables which are customers, transactions and products. Transaction table has a foreign key relationship with customer table where i map a customerid for a transaction. And i also have another table which is called transprods where it stores the information of which items being sold by a transaction. Where it only consists of two columns both are foreign keys which are transaction_id and product_id. How ever this particular table isn't getting generated in the diagram and also it doesn't generate code. What is the cause for this?! but in the model browser i do see the transprod inside the table directory. What i am doing wrong here any help would be greatly appreciated. And also my database is mysql.

This is "by design"

When you have a table that contains only foreign keys to two other tables, it will show up in the model as a many-to-many relationship between these two other tables.

If you add an extra field to this connector table, for example created date, then it will show up in the model as a separate table.

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