This project is read-only.

Many-to-Many scenario


I have a many to many scenario as follows. There are Roles and Users linked via a bridging table. I want to be able to add/remove existing users to a role without ever deleting a user from the database. The way the template currently works creates two problems
for this type of scenario.
  1. When you add an existing user to the UserList the UserList's IsDirty property will be false since the user in the list is an existing user and is not dirty or new.
  2. When you remove a user from the UserList the child is marked as Deleted but I only want the briding table's record to be deleted not the actual user record.
    I was able to solve number one by adding and extra piece of code in the many-to-many handling section of the template. But I'm not sure how to handle the second problem. Any suggestions? I'm thinking of somehow indicating that only the collection(bridging
    table) must be updated and mark the user with some sort of DoNotDeleteNavigationProperty or something.
    Any suggestions?

file attachments


eblanchette wrote Jan 4, 2011 at 3:19 PM

I have solved a similar scenario, I am joining the BO's I modified so that they can be put into a template. Methods to look at : Test1EC.Server.cs ->Child_Update Test3EC.Server.cs -> child_delete


wrote Feb 9, 2011 at 11:55 AM

wrote Jul 7, 2012 at 12:18 PM

wrote Feb 14, 2013 at 7:01 PM