views:

90

answers:

1

Hello,

I have probably stupid question but how Can I create Many-To-Many relationship with create option "Model First".

I have read this article http://learnentityframework.com/LearnEntityFramework/tutorials/many-to-many-relationships-in-the-entity-data-model/ but here the autor haven't provided to much description and It is "Database First" option.

So is it possible to have two (not three) Entities in Model, chose many to many and Entity Framework will create association table automatically when "Create Database from Model" executed.

Regards, Daniel Skowroński

+2  A: 

Drag association from the Toolbox in Model Designer and change the multiplicity of both ends to (*) in association properties.

Yury Tarabanko
@Yury TarabankoYes, now I know that, I forgot to provide answer to my own question.The problem is that when you have association 1 to Many and later you want to change it to Many to Many you will get Validation Error.It is weird but you have to delete it and create new with Many to Many at the beginning.Regards,Daniel Skowroński
Daniel