Table of Contents

Class AggregateRootStateProviders

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

Represents an implementation of IAggregateRootStateProviders.

public class AggregateRootStateProviders : IAggregateRootStateProviders
Inheritance
AggregateRootStateProviders
Implements
Inherited Members

Remarks

Initializes a new instance of the AggregateRootStateProviders class.

Constructors

AggregateRootStateProviders(IReducers, IProjections, IServiceProvider)

Represents an implementation of IAggregateRootStateProviders.

public AggregateRootStateProviders(IReducers reducers, IProjections projections, IServiceProvider serviceProvider)

Parameters

reducers IReducers

All the reducers in the system.

projections IProjections

IProjections to possibly get state from.

serviceProvider IServiceProvider

The IServiceProvider.

Remarks

Initializes a new instance of the AggregateRootStateProviders class.

Methods

CreateFor<TState>(IAggregateRootContext)

public Task<IAggregateRootStateProvider<TState>> CreateFor<TState>(IAggregateRootContext aggregateRootContext)

Parameters

aggregateRootContext IAggregateRootContext

The IAggregateRootContext for the aggregate root.

Returns

Task<IAggregateRootStateProvider<TState>>

A new IAggregateRootStateProvider<TState> instance.

Type Parameters

TState

Type of state for the aggregate root.

Exceptions

MissingAggregateRootStateProvider

Thrown if it can't resolve a state provider for the aggregate root.

AmbiguousAggregateRootStateProvider

Thrown if there are multiple state providers for the same aggregate root, this is not allowed.