Hi all,
I have a class called User. User can have one or more roles, defined in an bitmask enum. The user has a Role property that i can use via:
user.Roles = Roles.User | Roles.Other;
In the database I have a Users table and a User_Roles table. For every role that a user has, i want to store it in the Users_Roles table with the UserID and the string representation of the Role. for example, the data stored for the previous example would be:
User_Roles
---
UserID Role
23 User
23 Other
how would i create the mapping on this? i've read the examples, and they all seem to map it straight to the User table.