コード例 #1
0
 public ActionResult EditPost(EditPostViewModel model)
 {
     try
     {
         //if (!ModelState.IsValid) return View(model);
         var post = _managerPost.GetPostById(model.ID);
         post.description = model.Description;
         _managerPost.Update(post);
         return RedirectToAction("MyPage", "Profile");
     }
     catch (Exception)
     {
         return View();
     }
 }
コード例 #2
0
 public ActionResult EditPost(EditPostViewModel model, long numPost)
 {
     if (!ModelState.IsValid) return View(model);
     var post = _managerPost.GetPostById(numPost);
     model = Mapper.Map<Post, EditPostViewModel>(post);
     return View(model);
 }