ncqrs/ncqrs — pull request #81 by ProAvia (2011-10-19 16:22:47+00:00)
Title: EventServiceMappedByConvention

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