public async Task <IActionResult> PutContact(string id, Contact contact) { if (id != contact.ContactId) { return(BadRequest()); } _context.Entry(contact).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContactExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutDeal(string id, Deal deal) { if (id != deal.DealId) { return(BadRequest()); } _context.Entry(deal).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DealExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutProperty(string id, Property @property) { if (id != @property.PropertyId) { return(BadRequest()); } _context.Entry(@property).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PropertyExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }