예제 #1
0
 public void EditarAutor(Autor autor)
 {
     using (var db = new LivrariaEntities())
     {
         db.Entry(autor).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
예제 #2
0
        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));
        }