association and fieldhttp://forums.asp.net/t/1771018.aspx/1?association+and+fieldSat, 18 Feb 2012 17:07:15 -050017710184838743http://forums.asp.net/p/1771018/4838743.aspx/1?association+and+fieldassociation and field <p>I have two entity that they have a many-to-many association. In use Model First. In sql Database, a separate table is created for many-to-many association composed by two table primary key.&nbsp;I want to add some fields to this table in EF. How can I do this?</p> 2012-02-18T12:05:41-05:004838942http://forums.asp.net/p/1771018/4838942.aspx/1?Re+association+and+fieldRe: association and field <p>Create a new table that has the fields you want to add plus a PK for the new table and a foreign key to each of the other tables.&nbsp; This will create a one-to-many relationship between each of the existing tables and the new one, which is effectively the same as a many-to-many between the existing ones.&nbsp; For an example of that see the Enrollment table in this tutorial:</p> <p><a href="http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-a-more-complex-data-model-for-an-asp-net-mvc-application">http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-a-more-complex-data-model-for-an-asp-net-mvc-application</a></p> <p>&nbsp;</p> <p>&nbsp;</p> 2012-02-18T17:07:15-05:00