Esempio n. 1
0
        public async Task <IActionResult> Withdraw([FromForm][Required] WithdrawRequest request)
        {
            var input = new WithdrawInput(
                new AccountId(request.AccountId),
                new PositiveMoney(request.Amount));
            await _mediator.PublishAsync(input);

            return(_presenter.ViewModel);
        }
        public async Task <IActionResult> Withdraw(
            [FromServices] IMediator mediator,
            [FromServices] WithdrawPresenter presenter,
            [FromForm][Required] WithdrawRequest request)
        {
            var input = new WithdrawInput(
                request.AccountId,
                request.Amount);
            await mediator.PublishAsync(input)
            .ConfigureAwait(false);

            return(presenter.ViewModel);
        }