0

I've got two tables that have related items through a connection-table.

The connection table holds TableA-ItemId and TableB-ItemId. In my Entity-model I want ObjectA to have a collection of items from TableB. How can I achieve this using Entity Framework?

Kulvis
  • 655
  • 11
  • 33

1 Answers1

1

What your looking for is how to create a Many-to-Many relationship using Entity Framrwork. I going to assume your using Code First approach.

http://www.codeproject.com/Articles/234606/Creating-a-Many-To-Many-Mapping-Using-Code-First

That project should get you on the right foot

or How to have Many to Many Association in Entity Framework Code First Should be able to get you a quicker start. Good discussion in that thread.

Community
  • 1
  • 1
Blast_dan
  • 1,135
  • 9
  • 18