public async Task <IActionResult> PutPaymentDetail([FromRoute] Guid id, [FromBody] PaymentDetail paymentDetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != paymentDetail.ID) { return(BadRequest()); } _context.Entry(paymentDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymentDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCountry(Guid id, Country country) { if (id != country.ID) { return(BadRequest()); } _context.Entry(country).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CountryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPayment(int id, Payment payment) { if (id != payment.paymentId) { return(BadRequest()); } _context.Entry(payment).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutProductType(Guid id, ProductType productType) { if (id != productType.ID) { return(BadRequest()); } _context.Entry(productType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task Update(Payments payments) { paymentDbContext.Entry(payments).State = EntityState.Modified; await Task.CompletedTask; }
public async Task Update(TEntity model) { _dbSet.Attach(model); _context.Entry(model).State = EntityState.Modified; }