// GET: Admin/MatchTheWords/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MatchTheWord matchTheWord = db.MatchTheWords.Find(id); if (matchTheWord == null) { return(HttpNotFound()); } db.MatchTheWords.Remove(matchTheWord); db.SaveChanges(); return(RedirectToAction("Create", "MatchTheWords", new { id = matchTheWord.BloqueId })); }
// GET: Admin/MatchTheWords/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MatchTheWord matchTheWord = db.MatchTheWords.Find(id); if (matchTheWord == null) { return(HttpNotFound()); } MatchTheWordEditViewModel viewModel = new MatchTheWordEditViewModel(); viewModel.Inicializar(matchTheWord.BloqueId); viewModel.MatchTheWord = matchTheWord; return(View(viewModel)); }