After using .NET for several years, I've spent the last few months in the far off land of Ruby on Rails. While I can clearly see where much of Microsoft's MVC framework got it's influence, one of the things that I find myself suddenly missing when development in .NET are the Rails Model callbacks.
Specifically, you can add a callback to before_save, after_save, before_create, after_create
, etc. and then specify a function to be called at those points in execution (which seems very similar to aspect oriented programming).
My question is, out of the box, does .NET 3.5/ASP.NET MVC offer anything similar to the callbacks in Rails? For example, if I have an inserted_datetime
and updated_datetime
column on one of my database tables, instead of making sure those columns get updated in the controller, I'd like to be able to tell my model that every time the "Group" object gets saved to the database, update the updated_datetime
column.
Is this possible? Does this question even make sense?