public async Task Handle(long streamPosition, ProjectEvents.ToggleStateAdded @event, CancellationToken stoppingToken) { var eventAudit = CreateEventAudit(streamPosition, @event); var storeKey = Projection.StoreKey(@event.Id, @event.EnvironmentKey); var environmentState = (await Projections.Get(storeKey).ConfigureAwait(false)).EnvironmentState; environmentState.AddToggleState(eventAudit, @event.ToggleKey, @event.Value); var projection = Projection.Create(eventAudit, environmentState); await Projections.Update(storeKey, projection).ConfigureAwait(false); }
public async Task Handle(long streamPosition, ProjectEvents.ToggleStateAdded @event, CancellationToken stoppingToken) { var eventAudit = CreateEventAudit(streamPosition, @event); await CreateOrUpdateToggleState(eventAudit, @event.Id, @event.EnvironmentKey, @event.ToggleKey, @event.Value); }