public static IAggregate <TBoundedContext> CreateInstance( IAnemicModel <TBoundedContext> anemicModel, IAggregate <TBoundedContext> currentAggregate, CommandToAggregate command) => new Aggregate <TBoundedContext>( anemicModel, currentAggregate);
private Aggregate( IAnemicModel <TBoundedContext> anemicModel, IBoundedContextScope <TBoundedContext> scope) { _anemicModel = anemicModel; _scope = scope; }
public IAggregate <TBoundedContext> NewAggregate(IAnemicModel <TBoundedContext> anemicModel, CommandToAggregate command) => Aggregate <TBoundedContext> .CreateInstance(anemicModel, _scope);
public bool ValidateModel(IAnemicModel <IEmployee> anemicModel) => anemicModel is IEmployeeModel model &&
public static IAggregate <TBoundedContext> CreateInstance( IAnemicModel <TBoundedContext> anemicModel, IBoundedContextScope <TBoundedContext> scope) => new Aggregate <TBoundedContext>(anemicModel, scope);
public bool ValidateModel(IAnemicModel <IEmployee> anemicModel) => ValidateRoot(anemicModel.Invariants) && ValidateUser(anemicModel.Invariants) && ValidateDepartment(anemicModel.Invariants) && ValidateNtId(anemicModel.Invariants);
public AggregateResult <TBoundedContext> Handle( IAnemicModel <TBoundedContext> input, CommandToAggregate command, IBoundedContextScope <TBoundedContext> scope) => input.Id .Either(c => c == default, s => command.CorrelationToken, n => n)