C# Class Ncqrs.Eventing.Sourcing.Mapping.ExpressionBasedSourcedEventHandlerMappingStrategy

An internal event handler mapping strategy that creates event handlers based on mapping that is done by lambdas. If u inherit from the AggregateRootMappedWithExpressions u must implement the method InitializeEventHandlers(); Inside this method u can define the mapping between an event and an event source method in a strongly typed fashion. public class Foo : AggregateRootMappedWithExpressions { public override void InitializeEventHandlers() { Map{SomethingHappenedEvent}().ToHandler(x => SomethingHasHappened(x)); } public void SomethingHasHappened(SourcedEvent e) {} } public class SomethingHappenedEvent : SourcedEvent {}
Inheritance: ISourcedEventHandlerMappingStrategy
显示文件 Open project: SzymonPobiega/ncqrs Class Usage Examples

Public Methods

Method Description
GetEventHandlersFromAggregateRoot ( IEventSource eventSource ) : IEnumerable

Gets the event handlers from aggregate root based on the given mapping.

Private Methods

Method Description
CreateHandlerForMethod ( IEventSource eventSource, MethodInfo method, bool exact ) : ISourcedEventHandler

Converts the given method into an ISourcedEventHandler object.

Method Details

GetEventHandlersFromAggregateRoot() public method

Gets the event handlers from aggregate root based on the given mapping.
public GetEventHandlersFromAggregateRoot ( IEventSource eventSource ) : IEnumerable
eventSource IEventSource The aggregate root.
return IEnumerable