SubSonic: BeforeDelete

SubSonic provides overrides the method BeforeUpdate

and BeforeInsert

to carry out checks. Is there a way to hook up to an event BeforeDelete

if such a thing even exists?

+1


a source to share


2 answers


I am not aware of any BeforeDelete event, but you can always override the Delete method and handle it there. Remember to put any overridden methods in a separate file (SubSonic classes are partial), the convention is to put this file in the Modified folder and process it there.



0


a source


From what I remember, objects don't have a Delete method. You need to delete with a controller (at least in my templates!).

In my templates, I have PreDelete / PostDelete, PreDestroy / PostDestroy methods. We may have added them ourselves.



Take a look at this article with some sample code: http://blog.lavablast.com/post/2008/08/SubSonic-v21-Controller-and-Utilities.aspx (we have other articles on the same controllers in our blog. but they were for v2.0).

0


a source







All Articles