In 3.9, I created a class that inherited from DataService, and I would override for example OnDataObjectedCreated

Anytime a data object was created, my method was called.

How do I do that in DO4?

I created a class that inherits from SessionBound and implements ISessionService, and applied the ServiceAttribute on it. In its constructor I attached an event handler for the Session.EntityCreated event.

However, my event handler is never called when entities are created.

It gets returned if I use Session.Services.Get<t>, but this is not how I want to use it. I want it to be registered in the domain's services, and for the event handler to be registered when the domain is built.

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked May 16 '10 at 04:25

ara's gravatar image

ara
395868791


One Answer:

You can do this by implementing IModule : see this sample http://blog.alexyakunin.com/2010/03/sim ... -some.html

We are using this for similar purposes.

answered May 17 '10 at 08:48

Editor's gravatar image

Editor
46154156157

I've created the following issue: http://code.google.com/p/dataobjectsdot ... ail?id=654 as further investigation is required.

(May 17 '10 at 08:48) Dmitri Maximov Dmitri%20Maximov's gravatar image

Thanks, olorin! Works =)

(May 17 '10 at 08:48) ara ara's gravatar image

olorin wrote: My pleasure :)

(May 17 '10 at 08:48) Editor Editor's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×573

Asked: May 16 '10 at 04:25

Seen: 2,016 times

Last updated: May 16 '10 at 04:25

powered by OSQA