This project is read-only.

datastore "hooks"

Jul 7, 2011 at 8:52 PM

It looks that I will use saucedb for my next project  so I will have some ideas for enhancements.

It would be nice to have some "hook points" on datastore. I would like to attach beforeinsert/beforeupdate eventhandler, where I could "influent" on object being inserted/saved into database. For example: couple of my entities have field "LastEdited". I would like to fill this field with timestamp value and I would like to do it in one point (I know this could be done by attributes but for some fields I have more complicated functionality). Is it possible to add this kind of feature?


p.s. oracle support is comming in next few weeks...

Jul 7, 2011 at 9:06 PM

I've thought about adding these before actually, only reason I haven't is cause I haven't had a need for them yet.

Jul 7, 2011 at 9:08 PM

I'll add you as a developer as soon as the project administration is available again (looks like codeplex is doing some maintenance)

Jul 8, 2011 at 1:52 PM

Welcome to the team, also I do have this project under CI if you provide me with your email or some such I can set you up to get notifications when it builds and the status

Jul 8, 2011 at 2:02 PM

my email address is matejg at gmail dot com

Aug 7, 2011 at 3:19 PM

I saw, that you add events to Datastore (ObjectUpdating, ObjectDeleting, ObjectLoaded). What I miss is: ObjectInserting. And it would be also nice that base class for event arguments (for Updating, Deleting, Inserting) is not EventArgs, but CancelEventArgs (with possibility to cancel).


p.s. If you agree I can add it in source code repository (i belive that I have permision becouse you add me as developer...?!)

Aug 8, 2011 at 2:39 AM
Edited Aug 8, 2011 at 2:40 AM

That change sounds fine to me, and I modified your permissions, you should be able to check in code changes now.


Please follow my style rules for any code changes you submit.  I'll add them into the wiki here in just a moment.

Aug 8, 2011 at 1:16 PM

They can be found here

Aug 11, 2011 at 8:00 AM


Aug 11, 2011 at 1:15 PM

I looked over your this change and it looks good!  If you get a chance can you write a couple of unit tests to cover these new code branches?