コード例 #1
0
        /// <summary>
        ///     Executes the Use Case.
        /// </summary>
        /// <returns>Task.</returns>
        public Task Execute(DepositInput input)
        {
            if (input.ModelState.IsValid)
            {
                return(this.DepositInternal(input.AccountId, input.Amount));
            }

            this._outputPort?.Invalid(input.ModelState);
            return(Task.CompletedTask);
        }
コード例 #2
0
        /// <inheritdoc />
        public Task Execute(Guid accountId, decimal amount, string currency)
        {
            var input = new DepositInput(accountId, amount, currency);

            if (input.ModelState.IsValid)
            {
                return(this.DepositInternal(input.AccountId, input.Amount));
            }

            this._outputPort?.Invalid(input.ModelState);
            return(Task.CompletedTask);
        }