예제 #1
0
        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);
        }
예제 #2
0
        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);
        }