Interface IReactorMethodArgumentsResolver

Namespace
Cratis.Chronicle.Reactors
Assembly
Cratis.Chronicle.dll

Defines a system that resolves the arguments to pass to a reactor handler method.

public interface IReactorMethodArgumentsResolver
Extension Methods

Remarks

The first parameter of a handler method is always the event it reacts to. Any further parameters are resolved as dependencies: an EventContext parameter receives the event context, a ReactorDelivery parameter receives the identity of this delivery, a read model parameter is materialized strongly consistent from its reducer or projection, and any other parameter is resolved from the IServiceProvider.

Methods

Resolve(MethodInfo, object, object, EventContext, IEventStore?, IServiceProvider?)

Resolve the arguments for invoking a reactor handler method.

Task<object?[]> Resolve(MethodInfo method, object reactor, object @event, EventContext eventContext, IEventStore? eventStore, IServiceProvider? serviceProvider)

Parameters

method MethodInfo

The MethodInfo of the handler method to resolve arguments for.

reactor object

The reactor instance the method belongs to.

event object

The deserialized event that triggered the reactor.

eventContext EventContext

The EventContext for the triggering event.

eventStore IEventStore

The IEventStore used to detect and materialize read model parameters.

serviceProvider IServiceProvider

The IServiceProvider used to resolve any other dependencies.

Returns

Task<object[]>

The arguments to pass to the handler method, in declaration order.