Пример #1
0
 public static IAggregate <TBoundedContext> CreateInstance(
     IAnemicModel <TBoundedContext> anemicModel,
     IAggregate <TBoundedContext> currentAggregate,
     CommandToAggregate command)
 => new Aggregate <TBoundedContext>(
     anemicModel,
     currentAggregate);
Пример #2
0
 private Aggregate(
     IAnemicModel <TBoundedContext> anemicModel,
     IBoundedContextScope <TBoundedContext> scope)
 {
     _anemicModel = anemicModel;
     _scope       = scope;
 }
Пример #3
0
 public IAggregate <TBoundedContext> NewAggregate(IAnemicModel <TBoundedContext> anemicModel, CommandToAggregate command)
 => Aggregate <TBoundedContext> .CreateInstance(anemicModel, _scope);
Пример #4
0
 public bool ValidateModel(IAnemicModel <IEmployee> anemicModel)
 => anemicModel is IEmployeeModel model &&
Пример #5
0
 public static IAggregate <TBoundedContext> CreateInstance(
     IAnemicModel <TBoundedContext> anemicModel,
     IBoundedContextScope <TBoundedContext> scope)
 => new Aggregate <TBoundedContext>(anemicModel, scope);
Пример #6
0
 public bool ValidateModel(IAnemicModel <IEmployee> anemicModel)
 => ValidateRoot(anemicModel.Invariants) &&
 ValidateUser(anemicModel.Invariants) &&
 ValidateDepartment(anemicModel.Invariants) &&
 ValidateNtId(anemicModel.Invariants);
Пример #7
0
 public AggregateResult <TBoundedContext> Handle(
     IAnemicModel <TBoundedContext> input,
     CommandToAggregate command,
     IBoundedContextScope <TBoundedContext> scope)
 => input.Id
 .Either(c => c == default, s => command.CorrelationToken, n => n)