private static CreateHandlerForMethod ( IEventSource eventSource, |
||
eventSource | IEventSource | |
method | ||
attribute | Ncqrs.Eventing.Sourcing.Mapping.EventHandlerAttribute | |
return | ISourcedEventHandler |
private static ISourcedEventHandler CreateHandlerForMethod(IEventSource eventSource, MethodInfo method, EventHandlerAttribute attribute)
{
Type firstParameterType = method.GetParameters().First().ParameterType;
Action<IEvent> handler = e => method.Invoke(eventSource, new object[] { e });
return new TypeThresholdedActionBasedDomainEventHandler(handler, firstParameterType, attribute.Exact);
}