public virtual void Delete(TEntity entityToDelete) { if (context.Entry(entityToDelete).State == EntityState.Detached) { dbSet.Attach(entityToDelete); } dbSet.Remove(entityToDelete); }
public ActionResult Edit([Bind(Include = "Id,ISAN,Year,Description,Rating,Runtime,ProducerID,GenreID")] TestMovieTable testMovieTable) { if (ModelState.IsValid) { db.Entry(testMovieTable).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(testMovieTable)); }
public ActionResult Edit([Bind(Include = "ISBN,Title,Description,Year,Rating,NumPages,PublisherID,GenreID")] Book book) { if (ModelState.IsValid) { db.Entry(book).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(book)); }
public ActionResult Edit([Bind(Include = "Id,GameID,Title,Description,Year,Rating,GenreID,PublisherID,ProducerID")] TestGamesTable testGamesTable) { if (ModelState.IsValid) { db.Entry(testGamesTable).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(testGamesTable)); }