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
IReducersAll the reducers in the system.
projections
IProjectionsIProjections to possibly get state from.
serviceProvider
IServiceProviderThe IServiceProvider.
Remarks
Initializes a new instance of the AggregateRootStateProviders class.
Methods
CreateFor<TState>(IAggregateRootContext)
Create a IAggregateRootStateProvider<TState> for a specific AggregateRoot.
public Task<IAggregateRootStateProvider<TState>> CreateFor<TState>(IAggregateRootContext aggregateRootContext)
Parameters
aggregateRootContext
IAggregateRootContextThe 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.