Hi, There are several overrides available in DO like OnRemoving(), OnRemove(), OnValidate() but how do I prevent an entity from being removed as a function error. I've now implemented the OnRemoving() where I throw a custom Exception but it would seem not to be the appropriate place to do that kind of validation. When however I do it in the OnValidate() I get an Exception saying 'The entity is removed'. It's the good old chicken-and-egg problem again. Can not Validate an entity that is removed in the OnValidate() override. Regards Paul |
Hello Paul,
could you please provide some code examples? I think DataObjects.Net should properly handle deletions with validation. In other words if entity is removed it should not be validated anymore.
Hi Denis, I think you misread. It's not that we want to Validate the Entity. We want to prevent Entities from being removed in some cases.
Ok, the Business case is like this:
We import activities from our MOS application.
After import one can add new activities manually
Manually added activities may be removed. Imported ones not.
This one still needs an answer!
Hello Paul. I'm really sorry for such delay. Could you please contact us in Skype for further discussing of your problem?