Table of Contents

Class ProjectionAggregateRootStateProvider<TState>

Namespace
Cratis.Chronicle.Aggregates
Assembly
Cratis.Chronicle.dll

Represents an implementation of IAggregateRootStateProvider<TState> using a projection.

public class ProjectionAggregateRootStateProvider<TState> : IAggregateRootStateProvider<TState>

Type Parameters

TState

Type of state for the aggregate root.

Inheritance
ProjectionAggregateRootStateProvider<TState>
Implements
Inherited Members

Remarks

Initializes a new instance of the ProjectionAggregateRootStateProvider<TState> class.

Constructors

ProjectionAggregateRootStateProvider(IAggregateRootContext, IProjections)

Represents an implementation of IAggregateRootStateProvider<TState> using a projection.

public ProjectionAggregateRootStateProvider(IAggregateRootContext aggregateRootContext, IProjections projections)

Parameters

aggregateRootContext IAggregateRootContext

The AggregateRoot the state is for.

projections IProjections

IProjections to use for getting state.

Remarks

Initializes a new instance of the ProjectionAggregateRootStateProvider<TState> class.

Methods

Dehydrate()

Dehydrate any state.

public Task Dehydrate()

Returns

Task

Awaitable task.

Provide()

Handle state for an AggregateRoot.

public Task<TState?> Provide()

Returns

Task<TState>

State provided.

Update(TState?, IEnumerable<object>)

Update the state of an AggregateRoot with events.

public Task<TState?> Update(TState? initialState, IEnumerable<object> events)

Parameters

initialState TState

The initial state to update from.

events IEnumerable<object>

The events to update with.

Returns

Task<TState>

Updated state.