private void Process()
        {
            var wallets = _walletQueryService.AllWallets().Where(x => x.WeekWithdrawAmount > 0);

            if (wallets.Any())
            {
                foreach (var wallet in wallets)
                {
                    var command = new ClearWeekWithdrawAmountCommand()
                    {
                        AggregateRootId = wallet.Id
                    };
                    _commandService.SendAsync(command);
                }
            }
        }
Example #2
0
 public void Handle(ICommandContext context, ClearWeekWithdrawAmountCommand command)
 {
     context.Get <Wallet>(command.AggregateRootId).ClearWeekWithdrawAmount();
 }