Hello,
I have a many - to - many relation.
Users
Roles
Users2Roles.
For this relation I have 1 bag defined in Users.hbm.xml.
Code:
<bag name="Roles" table="
Users2Roles" inverse="true" lazy="true" cascade="none">
<key column="userId" />
<many-to-many class="Role, namespace">
<column name="roleId" not-null="true"/>
</many-to-many>
</bag>
My question is which is the right way of deleting a role from the user role list.
If I'm setting inverse = false and then user.Roles.Remove(roleToDelete) NH makes a delete all and then insert.
I want to make a delete operation without mapping the Users2Roles table.
Is there any way to do that?
Thank you!