public async Task <IActionResult> Put(int id, Autor autor) { if (id != autor.Id) { return(BadRequest()); } _context.Entry(autor).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AutorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutLivro(Guid id, Livro livro) { if (id != livro.Id) { return(BadRequest()); } _context.Entry(livro).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LivroExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }