Ejemplo n.º 1
0
        public async Task <OperationResult> SavePayment(PaymentViewModel paymentViewModel)
        {
            var payment = await CreatePaymentFromViewModel(paymentViewModel).ConfigureAwait(false);

            var result = await modifyPaymentAction.AddPayment(payment)
                         .ConfigureAwait(false);

            await context.SaveChangesAsync()
            .ConfigureAwait(false);

            return(!result.Success
                ? OperationResult.Failed(result.Message)
                : OperationResult.Succeeded());
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public async Task <OperationResult> SavePayment(PaymentViewModel paymentViewModel)
        {
            var payment = await CreatePaymentFromViewModel(paymentViewModel);

            var result = await modifyPaymentAction.AddPayment(payment);

            if (!result.Success)
            {
                return(OperationResult.Failed(result.Message));
            }

            await context.SaveChangesAsync();

            return(OperationResult.Succeeded());
        }