示例#1
0
        public T GetById(Guid id)
        {
            IEnumerable <IEvent> events = _eventStorage.GetAllEventsForEventProvider(id);

            var aggregateRoot = (T)Activator.CreateInstance(typeof(T), id);

            aggregateRoot.LoadFromHistory(events);

            return(aggregateRoot);
        }