C# 클래스 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 {}
상속: ISourcedEventHandlerMappingStrategy
파일 보기 프로젝트 열기: SzymonPobiega/ncqrs 1 사용 예제들

공개 메소드들

메소드 설명
GetEventHandlersFromAggregateRoot ( IEventSource eventSource ) : IEnumerable

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

비공개 메소드들

메소드 설명
CreateHandlerForMethod ( IEventSource eventSource, MethodInfo method, bool exact ) : ISourcedEventHandler

Converts the given method into an ISourcedEventHandler object.

메소드 상세

GetEventHandlersFromAggregateRoot() 공개 메소드

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