Exemplo n.º 1
0
        public TEntity GetById(EntityId id)
        {
            var entityEvents = Storage.LatestEvents(id);

            if (!entityEvents.Any())
            {
                throw new EntityNotFoundException(id);
            }
            var result = EntityBuilder.BuildFromHistory(entityEvents);

            result.WithDomainEvents(DomainEvents);
            return(result);
        }