public async Task <PaymentDTO> PatchAsync(PaymentUpdateDTO dto) { this.Logger.LogDebug($"{nameof(PaymentUpdateService)} called for {dto.PaymentId}"); return(this.Mapper.Map <PaymentDTO>( await this.PaymentUpdateService.UpdateAsync(Mapper.Map <PaymentUpdateModel>(dto)))); }
public async Task Update(int id, PaymentUpdateDTO model) { var entry = _context.Payments.Single(x => x.PaymentId == id); entry.PaymentId = model.PaymentId; entry.CreditCardId = model.CreditCardId; entry.Description = model.Description; entry.CvcCreditCard = model.CvcCreditCard; await _context.SaveChangesAsync(); }
public async Task <ActionResult> Update(int id, PaymentUpdateDTO model) { if (_PaymentService.Existencia(id) == true) { await _PaymentService.Update(id, model); return(NoContent()); } else { return(NotFound()); } }