public Book Save(Book book) { if (book.Id == 0) context.Books.Add(book); else context.Entry(book).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); return book; }
public void Delete(Book book) { context.Books.Remove(book); context.SaveChanges(); }