public Task Handle(RequestWithdrawalCommand message, IMessageHandlerContext context) { try { var account = GetById(message.AccountId); account.Withdraw(message.Amount); _messageSession.Send(message).ConfigureAwait(false); Task reply = context.Reply("RequestWithdrawalCommand"); return(reply); } catch (Exception) { return(context.Reply("invalid operation")); } }
public void WithdrawFromAccount(string accountGuid, int amount) { var Command = new RequestWithdrawalCommand(accountGuid, amount); }