Interface IAggregateRootStateProviders
- Namespace
- Cratis.Chronicle.Aggregates
- Assembly
- Cratis.Chronicle.dll
Defines a system that can manage IAggregateRootStateProvider<TState> for AggregateRoot.
public interface IAggregateRootStateProviders
Methods
CreateFor<TState>(IAggregateRootContext)
Create a IAggregateRootStateProvider<TState> for a specific AggregateRoot.
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.