NoDuplicates Question

NoDuplicates Question

Old forum URL: forums.lhotka.net/forums/t/1728.aspx


jspurlin posted on Thursday, November 09, 2006

I have been using CSLA for  only a little while.  I have a question about the NoDuplicates InstanceRule like which is used with Role.cs in PTracker.

I noticed in my app as well as the PTracker app that if a duplicate is found, it may not be passed to the data portal for update, but the "duplicate" is still in memory on the client.

For example, I can add the same RoleId and RoleName in the PTracker project. Even though the duplicate value is not passed through the data portal and persisted to the database, it is momentarily still in memory and viewable to the user.  How may I ensure that the in-memory business object removed the bad duplicate value?

Thank you,
John Spurlin

ajj3085 replied on Thursday, November 09, 2006

Well, usually you disable the save button, and give an indication to the user that the duplicate rule is broken.  Its up to the user to then remove the duplicate.

HTH
andy

Copyright (c) Marimer LLC