public void EditarAutor(Autor autor) { using (var db = new LivrariaEntities()) { db.Entry(autor).State = EntityState.Modified; db.SaveChanges(); } }
public IHttpActionResult Update(int id, [FromBody] Livro editBook) { if (id != editBook.Id) { return(BadRequest()); } livrariaEntities.Entry(editBook).State = EntityState.Modified; livrariaEntities.SaveChanges(); return(StatusCode(HttpStatusCode.NoContent)); }