public ActionResult DeleteConfirmed(int id) { LearntAbout learntAbout = _uow.Repository <LearntAbout>().Get(c => c.Id == id); _uow.Repository <LearntAbout>().Delete(learntAbout); _uow.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit( [Bind(Include = "Id,Description,InsertedDateTime,InsertedBy,ModifiedDateTime,ModifiedBy")] LearntAbout learntAbout) { if (ModelState.IsValid) { _uow.Repository <LearntAbout>().Attach(learntAbout); _uow.SaveChanges(); return(RedirectToAction("Index")); } return(View(learntAbout)); }
// GET: LearntAbout/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LearntAbout learntAbout = _uow.Repository <LearntAbout>().Get(c => c.Id == id); if (learntAbout == null) { return(HttpNotFound()); } return(View(learntAbout)); }