public AccountsController( IWithdrawUseCase withdrawUseCase, Presenter presenter) { _withdrawUseCase = withdrawUseCase; _presenter = presenter; }
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 !); }
#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 !); }
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(); }