pjvds / ncqrs

Ncqrs Framework - The CQRS Framework for .NET
Other
539 stars 164 forks source link

EventServiceMappedByConvention #81

Open ProAvia opened 12 years ago

ProAvia commented 12 years ago

This service has been added to allow publishing events without the need of an Aggregate Root. For instance if a pure CRUD bounded context has no need of a domain model but wants to notify the remaining application of changes as they occur.

Use this service by subclassing, e.g.:

public class MyCrudContextEventSource : EventPublisherMappedByConvention { protected void OnMyItemCreated(MyItemCreated evnt) { } protected void OnMyItemUpdated(MyItemUpdated evnt) { } protected void OnMyItemDeleted(MyItemDeleted evnt) { } // etc. }

An event can then be published like this:

var evnt = new MyItemUpdated { .... }; new MyCrudContextEventSource().Raise(evnt);

Questions? Contact me at:

Twitter: @dtraub Mail: dennis.traub@gmail.com

By the way, I appreciate your great work! This framework has been a lot of help.

Cheers,

Dennis