Example #1
0
 public virtual void Delete(TEntity entityToDelete)
 {
     if (context.Entry(entityToDelete).State == EntityState.Detached)
     {
         dbSet.Attach(entityToDelete);
     }
     dbSet.Remove(entityToDelete);
 }
Example #2
0
 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));
 }
Example #3
0
 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));
 }
Example #4
0
 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));
 }