I Use Ef model first and two tables have many-to-many relation. I want to insert data in table that created by ef in database connect two table. How can I do this?
In my mind,first create an empty model ef file,design your model entities first by dragging and dropping model entity from the toolbox,and then Drag association from the Toolbox in Model Designer and change the multiplicity of both ends to (*) in association
properties.
irani
Participant
898 Points
289 Posts
Model first and mvc
Feb 28, 2012 08:33 AM|LINK
I Use Ef model first and two tables have many-to-many relation. I want to insert data in table that created by ef in database connect two table. How can I do this?
tdykstra
Contributor
4463 Points
624 Posts
Microsoft
Moderator
Re: Model first and mvc
Feb 28, 2012 02:14 PM|LINK
See this tutorial for an example:
http://www.asp.net/web-forms/tutorials/getting-started-with-ef/the-entity-framework-and-aspnet-getting-started-part-5
The tutorial uses a database first example, but the API is identical for model first.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Model first and mvc
Mar 01, 2012 12:22 AM|LINK
Hello irani:)
In my mind,first create an empty model ef file,design your model entities first by dragging and dropping model entity from the toolbox,and then Drag association from the Toolbox in Model Designer and change the multiplicity of both ends to (*) in association properties.