Table of Contents

Interface IReducerInvoker

Namespace
Cratis.Chronicle.Reducers
Assembly
Cratis.Chronicle.dll

Defines a system that can invoke reducers.

public interface IReducerInvoker

Properties

EventTypes

Gets the event types the reducer is for.

IImmutableList<EventType> EventTypes { get; }

Property Value

IImmutableList<EventType>

ReadModelType

Gets the type of the read model.

Type ReadModelType { get; }

Property Value

Type

Methods

Invoke(IServiceProvider, IEnumerable<EventAndContext>, object?)

Invoke the reducer for a set of events.

Task<ReduceResult> Invoke(IServiceProvider serviceProvider, IEnumerable<EventAndContext> eventsAndContexts, object? initialReadModelContent)

Parameters

serviceProvider IServiceProvider

The IServiceProvider for creating the actual instance of the reducer.

eventsAndContexts IEnumerable<EventAndContext>

The events to reduce from.

initialReadModelContent object

The initial state of the read model, can be null.

Returns

Task<ReduceResult>

The reduced read model.

Remarks

This is to be used for events that all have a key the same as the read model.