Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        Task IEventHandler <OutcomeAmountChanged> .HandleAsync(OutcomeAmountChanged payload)
        {
            if (SortDescriptor.Type == OutcomeOverviewSortType.ByAmount)
            {
                Reload();
            }
            else
            {
                UpdateModel(payload, model => model.Amount = payload.NewValue);
            }

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