many-to-many, poco, ef4

Posted by Lari13 on Stack Overflow See other posts from Stack Overflow or by Lari13
Published on 2010-12-21T13:51:40Z Indexed on 2010/12/21 13:54 UTC
Read the original article Hit count: 359

I have 3 entities:

Goods [GID(PK), GoodName]
Persons [PID(PK), PersonName]
Roles [RID(PK), RoleName]

But now I need to associate these object with each other. In other words, each Good can have MANY Persons in MANY Roles.

For example:

Book (GID#1), can have 3 associated persons:

1. Jack (PID#1) in role Author (RID#1)
2. Jack (PID#1) in role Editor (RID#2)
3. Bill (PID#2) in role Painter (RID#3)

How can it be done in POCO format in Entity Framework 4?

© Stack Overflow or respective owner

Related posts about entity-framework-4

Related posts about many-to-many