datastore "hooks"

Editor
Jul 7, 2011 at 7: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?

Matej

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

Coordinator
Jul 7, 2011 at 8: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.

Coordinator
Jul 7, 2011 at 8: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)

Coordinator
Jul 8, 2011 at 12: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

Editor
Jul 8, 2011 at 1:02 PM

my email address is matejg at gmail dot com

Editor
Aug 7, 2011 at 2: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).

Matej

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...?!)

Coordinator
Aug 8, 2011 at 1:39 AM
Edited Aug 8, 2011 at 1: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.

Coordinator
Aug 8, 2011 at 12:16 PM

They can be found here

 

http://sauce.codeplex.com/wikipage?title=Style%20Rules&referringTitle=Documentation

Editor
Aug 11, 2011 at 7:00 AM

Commited.

Coordinator
Aug 11, 2011 at 12: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?