public async Task <IActionResult> PutAuthor(int id, Author author) { if (id != author.AuthorId) { return(BadRequest()); } _context.Entry(author).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AuthorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutStockLocal(int id, StockLocal stockLocal) { if (id != stockLocal.Id) { return(BadRequest()); } _context.Entry(stockLocal).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StockLocalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutBook(int id, Book book) { if (id != book.BookId) { return(BadRequest()); } _context.Entry(book).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPublishCompany(int id, PublishCompany publishCompany) { if (id != publishCompany.PublishCompanyId) { return(BadRequest()); } _context.Entry(publishCompany).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PublishCompanyExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }