コード例 #1
0
 public AccountsController(
     IWithdrawUseCase withdrawUseCase,
     Presenter presenter)
 {
     _withdrawUseCase = withdrawUseCase;
     _presenter       = presenter;
 }
コード例 #2
0
        public async Task <IActionResult> Withdraw(
            [FromServices] IWithdrawUseCase useCase,
            [FromRoute][Required] Guid accountId,
            [FromForm][Required] decimal amount,
            [FromForm][Required] string currency)
        {
            useCase.SetOutputPort(this);

            await useCase.Execute(new WithdrawInput(accountId, amount, currency))
            .ConfigureAwait(false);

            return(this._viewModel !);
        }
コード例 #3
0
#pragma warning disable SCS0016 // Controller method is potentially vulnerable to Cross Site Request Forgery (CSRF).
        public async Task <IActionResult> Withdraw(
#pragma warning restore SCS0016 // Controller method is potentially vulnerable to Cross Site Request Forgery (CSRF).
            [FromServices] IWithdrawUseCase useCase,
            [FromRoute][Required] Guid accountId,
            [FromForm][Required] decimal amount,
            [FromForm][Required] string currency)
        {
            useCase.SetOutputPort(this);

            await useCase.Execute(accountId, amount, currency)
            .ConfigureAwait(false);

            return(this._viewModel !);
        }
コード例 #4
0
 public AccountsController(IWithdrawUseCase withdrawService)
 {
     this.withdrawService = withdrawService;
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="WithdrawValidationUseCase" /> class.
 /// </summary>
 public WithdrawValidationUseCase(IWithdrawUseCase withdrawUseCase) => this._useCase = withdrawUseCase;
 /// <summary>
 ///     Initializes a new instance of the <see cref="WithdrawValidationUseCase" /> class.
 /// </summary>
 public WithdrawValidationUseCase(IWithdrawUseCase useCase, Notification notification)
 {
     this._useCase      = useCase;
     this._notification = notification;
     this._outputPort   = new WithdrawPresenter();
 }