I have tables like this:
tblUsers
int UserID
string UserName
tblUsersInRoles
int UserID
int RoleID
tbleRoles
int RoleID
string RoleName
A user can be in many roles.
Is there a way to create my mapping file for my users so that my users object contains a list of Roles? I've figured out to do it so that I have a list of RoleID's like this:
<bag name="Roles" table="tblUsersInRoles" cascade="all">
<key column="UserId"/>
<one-to-many class="UsersInRoles"/>
</bag>
Is there a way to take that the next step via the mapping file and store the roles themselves instead of just their ID's?
Thanks for any help