Exemplo n.º 1
0
        public async Task DeletePayment(int id)
        {
            Payment payment = await savePaymentDbAccess.GetPaymentByIdAsync(id);

            payment.ChargedAccount.RemovePaymentAmount(payment);
            payment.TargetAccount?.RemovePaymentAmount(payment);

            savePaymentDbAccess.DeletePayment(payment);
        }
Exemplo n.º 2
0
        public async Task <OperationResult> DeletePayment(int id)
        {
            var payment = await savePaymentDbAccess.GetPaymentById(id)
                          .ConfigureAwait(true);

            payment.ChargedAccount.RemovePaymentAmount(payment);
            payment.TargetAccount?.RemovePaymentAmount(payment);

            savePaymentDbAccess.DeletePayment(payment);

            return(OperationResult.Succeeded());
        }