Exemple #1
0
        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);
        }
Exemple #3
0
        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();
                }
            }
        }
Exemple #4
0
 Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload)
 {
     OnOutcomeAmountChangedEvent();
     return(Task.CompletedTask);
 }
Exemple #5
0
 Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload)
 => UpdateModel(payload, model => model.Amount = payload.NewValue);
Exemple #6
0
 Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload) => RaiseEvent(payload);
Exemple #7
0
 Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload)
 {
     return(UpdateState(() => Amount = payload.NewValue));
 }