Domain event being executed after transaction completes. How to get the concrete type.

220 views Asked by At

I wanted to publish a domain event after a transaction completes. So I have followed this article here: http://www.jayway.com/2013/06/20/dont-publish-domain-events-return-them/ and also had a look at this SO post: Should I Pass a repository to a Domain Method that fires an Event

Makes sense... but I am confused as to how to resolve the Interface collection to the concrete types. For example in the collection of IEvent there maybe 2-3 different types of events. How do I figure out which event was added to fire the correct handler?

1

There are 1 answers

1
Cool Breeze On BEST ANSWER

I found the answer in the comment of the following post: http://lostechies.com/jimmybogard/2014/05/13/a-better-domain-events-pattern/ i.e.

DomainEvents.Raise((dynamic) event)