public T GetById(Guid id) { IEnumerable <IEvent> events = _eventStorage.GetAllEventsForEventProvider(id); var aggregateRoot = (T)Activator.CreateInstance(typeof(T), id); aggregateRoot.LoadFromHistory(events); return(aggregateRoot); }