public async Task Handle(long streamPosition, ProjectEvents.EnvironmentStateDeleted @event, CancellationToken stoppingToken) { var tasks = new List <Task>(); foreach (var toggleKey in @event.ToggleKeys) { var eventAudit = CreateEventAudit(streamPosition, @event); var task = UpdateOrDeleteToggleState(eventAudit, @event.Id, @event.EnvironmentKey, toggleKey); tasks.Add(task); } await Task.WhenAll(tasks); }
public async Task Handle(long streamPosition, ProjectEvents.EnvironmentStateDeleted @event, CancellationToken stoppingToken) { var storeKey = Projection.StoreKey(@event.Id, @event.EnvironmentKey); await Projections.Delete(storeKey).ConfigureAwait(false); }