public virtual void Save(Type aggregateRootType, IEvent <TAuthenticationToken> @event) { Logger.LogDebug(string.Format("Saving aggregate root event type '{0}'", @event.GetType().FullName), string.Format("{0}\\Save", GetType().Name)); EventData eventData = EventBuilder.CreateFrameworkEvent(@event); string streamName = string.Format(CqrsEventStoreStreamNamePattern, aggregateRootType.FullName, @event.Id); eventData.AggregateId = streamName; eventData.Version = @event.Version; eventData.CorrelationId = @event.CorrelationId; PersistEvent(eventData); Logger.LogInfo(string.Format("Saving aggregate root event type '{0}'... done", @event.GetType().FullName), string.Format("{0}\\Save", GetType().Name)); }
public virtual void Save(Type aggregateRootType, IEvent <TAuthenticationToken> @event) { Logger.LogDebug(string.Format("Saving aggregate root event type '{0}'", @event.GetType().FullName), string.Format("{0}\\Save", GetType().Name)); EventData eventData = EventBuilder.CreateFrameworkEvent(@event); string streamName = GenerateStreamName(aggregateRootType, @event); eventData.AggregateId = streamName; eventData.AggregateRsn = @event.Id; eventData.Version = @event.Version; eventData.CorrelationId = @event.CorrelationId; PersistEvent(eventData); Logger.LogInfo(string.Format("Saving aggregate root event type '{0}'... done", @event.GetType().FullName), string.Format("{0}\\Save", GetType().Name)); TelemetryHelper.TrackMetric(string.Format("Cqrs/EventStore/Save/{0}", streamName), 1); }