private List <IEvent> DeserializeEvents(string stream, List <EventDescriptor> eventDescriptors) { var stopWatch = new Stopwatch(); stopWatch.Start(); var results = eventDescriptors.Select(desc => _eventStoreSerDes.Deserialize(desc.EventData, Type.GetType(desc.EventType)) as IEvent).ToList(); stopWatch.Stop(); _logger.LogDebug("EventStore.DeserializeEvents for {Stream} took {ElapsedMilliseconds} ms", stream, stopWatch.ElapsedMilliseconds); return(results); }
private object DeserializeSnapshot(string streamId, SnapshotDescriptor snapshotDescriptor) { var stopWatch = new Stopwatch(); stopWatch.Start(); var snapshot = _eventStoreSerDes.Deserialize(snapshotDescriptor.SnapshotData, Type.GetType(snapshotDescriptor.SnapshotType)); stopWatch.Stop(); _logger.LogDebug("SnapshotStore.DeserializeSnapshot for {Stream} took {ElapsedMilliseconds} ms", streamId, stopWatch.ElapsedMilliseconds); return(snapshot); }