コード例 #1
0
        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"));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        // 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));
        }