Ejemplo n.º 1
0
 public CustomersController(
     IMediator mediator,
     RegisterPresenter presenter)
 {
     _mediator  = mediator;
     _presenter = presenter;
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> Post(
            [FromServices] IMediator mediator,
            [FromServices] RegisterPresenter presenter,
            [FromForm][Required] RegisterRequest request)
        {
            var input = new RegisterInput(
                new SSN(request.SSN),
                new PositiveMoney(request.InitialAmount));
            await mediator.PublishAsync(input);

            return(presenter.ViewModel);
        }
        public async Task <IActionResult> Post(
            [FromServices] IMediator mediator,
            [FromServices] RegisterPresenter presenter,
            [FromForm][Required] RegisterRequest request)
        {
            var input = new RegisterInput(
                request.SSN,
                request.InitialAmount);

            await mediator.PublishAsync(input)
            .ConfigureAwait(false);

            return(presenter.ViewModel);
        }