public async Task <IActionResult> PutComic(long id, Comic comic) { if (id != comic.ComicId) { return(BadRequest()); } _context.Entry(comic).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ComicExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutVendor(long id, Vendor vendor) { if (id != vendor.VendorId) { return(BadRequest()); } _context.Entry(vendor).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VendorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }