public async Task <IActionResult> Transfer( [FromServices] ITransferUseCase useCase, [FromRoute][Required] Guid accountId, [FromRoute][Required] Guid destinationAccountId, [FromForm][Required] decimal amount, [FromForm][Required] string currency) { useCase.SetOutputPort(this); await useCase.Execute( accountId, destinationAccountId, 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> Transfer( #pragma warning restore SCS0016 // Controller method is potentially vulnerable to Cross Site Request Forgery (CSRF). [FromServices] ITransferUseCase useCase, [FromRoute][Required] Guid accountId, [FromRoute][Required] Guid destinationAccountId, [FromForm][Required] decimal amount, [FromForm][Required] string currency) { useCase.SetOutputPort(this); await useCase.Execute( accountId, destinationAccountId, amount, currency) .ConfigureAwait(false); return(this._viewModel !); }
/// <summary> /// Initializes a new instance of the <see cref="TransferUseCase" /> class. /// </summary> public TransferValidationUseCase(ITransferUseCase useCase, Notification notification) { this._useCase = useCase; this._notification = notification; this._outputPort = new TransferPresenter(); }
/// <summary> /// Initializes a new instance of the <see cref="TransferUseCase" /> class. /// </summary> public TransferValidationUseCase(ITransferUseCase transferUseCase) => this._useCase = transferUseCase;