title: Many to Many Mapping in EF
body: <p>We have a case in EF:</p>
  
  <p>We have 3 entities, say User, Role and Department. A User can play one or more roles in each department and that can be active or inactive. So, the columns in Mapping table are as follows:</p>
  
  <p>UserId, RoleId, DeptId, IsActive</p>
  
  <p>We are currently managing the mapping by creating another entity for mapping table, which forces to perform delete operations manually if I have to delete a relationship. </p>
  
  <p>IS there a way this can be achieved without any entity for mapping table. </p>
  
  <p>Thanks in advance. </p>