Пример #1
0
        public void ExecuteDomainCreate(Guid aggregateId, Action <T> action)
        {
            var aggregate = AggregateRootFactory.Build <T>(aggregateId);

            action(aggregate);
            _repository.Save(aggregate);
        }
Пример #2
0
        public T GetById(Guid aggregateId)
        {
            var t      = AggregateRootFactory.Build <T>(aggregateId);
            var events = _storage.GetEventsForAggregate <T>(aggregateId);

            t.LoadFromEvent(events);
            return(t);
        }