nservicebus - How to use interface as events in JOlivers CommonDomain and EventStore? -


I am conducting an exam by using CommonDomain and EventStore. I need to raise an event like this in my total:

  RiseEvent (bus.teite.in  (M = & gt; {m.Number = Number;}));   

And then later I have this handler:

  Apply Private Zero (changing the iPhone number number changed to the phone number) {this.Number = PhoneNumberChangedEvent.Number; }   

Unfortunately this does not work. I get an exception: "Commendemain.Core.HandlerForadman Avent Foreign Appearance: Overall, 'Phone' raised an event called 'iPhone noch manzedge' but handler was not handled for handling the message."

The problem here is "Object.Creast Instance" because it works with pure concrete sections. But I need the interface of my event. Can it be solved?

Edit: Just a note - I do not have to use the "bus" to make the object. It's just the easiest (only) way I'm currently 'IPhoneNumberChanged'. It would be great in any other way - just as long as I have an interface in the handler as logic.

In your manufacturer for your phone total, just add the following:

  This Registrar & lt; IPhoneNumberChanged & gt; (This.Apply);   

It will take care of the exception how the normal routing mechanism within a normal domain is a registration-based router, how to get an event for proper handling method compared to understanding it - all the reflections Without using it, another router has been written and is already part of the Commonwealth Project that uses reflection and more conference based.

A quick idea about your event name. Rather than saying that the phone number has changed, you want the event to change why the phone number From the perspective of the domain, why something is always more interesting and important is that the fact that a phone number usually changes is not interesting is the fact that it has changed because the person had transferred or canceled their account - which That's interesting and very important.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -