Beispiel #1
0
 public AccountController(INotifiable notifiable, IOpenAccountUseCase accountUseCase, IGetAccountUseCase getAccountUseCase)
     : base(notifiable)
 {
     _notifiable        = notifiable;
     _accountUseCase    = accountUseCase;
     _getAccountUseCase = getAccountUseCase;
 }
        public async Task <IActionResult> GetAsync(
            [FromServices] IGetAccountUseCase useCase,
            [FromRoute][Required] Guid accountId)
        {
            useCase.SetOutputPort(this);

            await useCase.ExecuteAsync(accountId);

            return(_viewModel);
        }
Beispiel #3
0
        public async Task <IActionResult> Get(
            [FromServices] IGetAccountUseCase useCase,
            [FromRoute][Required] Guid accountId)
        {
            useCase.SetOutputPort(this);

            await useCase.Execute(accountId)
            .ConfigureAwait(false);

            return(this._viewModel !);
        }
        public async Task <IActionResult> Get(
            [FromServices] IGetAccountUseCase useCase,
            [FromRoute][Required] GetAccountDetailsRequestV2 request)
        {
            useCase.SetOutputPort(this);

            await useCase.Execute(new GetAccountInput(request.AccountId))
            .ConfigureAwait(false);

            return(this._viewModel !);
        }
 public AccountsController(IGetAccountUseCase getAccountUseCase)
 {
     _getAccountsUseCase = getAccountUseCase;
     _presenter          = new Presenter();
 }
Beispiel #6
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="GetAccountValidationUseCase" /> class.
 /// </summary>
 public GetAccountValidationUseCase(IGetAccountUseCase useCase) => this._useCase = useCase;
Beispiel #7
0
 public GetAccountValidationUseCase(IGetAccountUseCase useCase)
 {
     _useCase = useCase;
 }
Beispiel #8
0
 public WhenGettingAnAccount()
 {
     _mockAccountRepository = new Mock <IAccountReadOnlyRepository>();
     _sut = new GetAccountUseCase(_mockAccountRepository.Object);
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="GetAccountValidationUseCase" /> class.
 /// </summary>
 public GetAccountValidationUseCase(IGetAccountUseCase useCase, Notification notification)
 {
     this._useCase      = useCase;
     this._notification = notification;
     this._outputPort   = new GetAccountPresenter();
 }