public IAggregate <TBoundedContext> GetAggregateByIdAndVersion(Guid id, int version, CommandToAggregate command) { var anemicModel = _unitOfWork.QueryRepository.GetQueryable() .Single(f => f.Id == id && f.Version == version); var aggregate = Aggregate <TBoundedContext> .CreateInstance(anemicModel, _scope); return(aggregate); }
public IAggregate <TBoundedContext> NewAggregate(IAnemicModel <TBoundedContext> anemicModel, CommandToAggregate command) => Aggregate <TBoundedContext> .CreateInstance(anemicModel, _scope);
.PipeTo(ck => Aggregate <TBoundedContext> .CreateInstance(input, scope)) // TODO: add changed values .PipeTo(a => new AggregateResult <TBoundedContext>(a, command, null));