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()); }
/// <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()); }