views:

164

answers:

1

So I have a database schema like this:

Users
UserId

RoleUserXRef
RoleUserId
RoleId
UserId

Roles
RoleId
Name

With foreign keys defined between User & RoleUserXRef and RoleUserXRef & Role. Basically, I have a one to many relationship between users and roles.

How would I model this in dbml, such that the generated User class has a list of Roles that the user has assigned to them?

+1  A: 

Creating a many-to-many releationship via simple DBML manipulation is not supported currently. You can extend the partial class to manually create properties, if you really want that sort of functionality "built in".

Greg Hurlman