Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload) { OutcomeOverviewViewModel viewModel = Items.FirstOrDefault(vm => payload.AggregateKey.Equals(vm.Key)); if (viewModel != null) { viewModel.Amount = payload.NewValue; Sort(lastSortDescriptor); } return(Task.CompletedTask); }
Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload) { if (SortDescriptor.Type == OutcomeOverviewSortType.ByAmount) { Reload(); } else { UpdateModel(payload, model => model.Amount = payload.NewValue); } return(Task.CompletedTask); }
public async Task HandleAsync(OutcomeAmountChanged payload) { using (ReadModelContext db = readModelContextFactory.Create()) { OutcomeEntity entity = await db.Outcomes.FindAsync(payload.AggregateKey.AsGuidKey().Guid); if (entity != null) { entity.Amount = payload.NewValue.Value; entity.Currency = payload.NewValue.Currency; await db.SaveChangesAsync(); } } }
Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload) { OnOutcomeAmountChangedEvent(); return(Task.CompletedTask); }
Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload) => UpdateModel(payload, model => model.Amount = payload.NewValue);
Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload) => RaiseEvent(payload);
Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload) { return(UpdateState(() => Amount = payload.NewValue)); }