public AggregateProvider( IUnitOfWork <TBoundedContext> unitOfWork, IBoundedContextScope <TBoundedContext> scope) { _unitOfWork = unitOfWork; _scope = scope; }
private Aggregate( IAnemicModel <TBoundedContext> anemicModel, IBoundedContextScope <TBoundedContext> scope) { _anemicModel = anemicModel; _scope = scope; }
public static IAggregate <TBoundedContext> CreateInstance( IAnemicModel <TBoundedContext> anemicModel, IBoundedContextScope <TBoundedContext> scope) => new Aggregate <TBoundedContext>(anemicModel, scope);
public AggregateResult <TBoundedContext> Handle( IAnemicModel <TBoundedContext> input, CommandToAggregate command, IBoundedContextScope <TBoundedContext> scope) => input.Id .Either(c => c == default, s => command.CorrelationToken, n => n)