コード例 #1
0
        public ActionResult Edit(Post post)
        {
            if (ModelState.IsValid) {
                post.Url = post.Title.ToUrl();
                post.Author = User.Identity.Name;
                post.Date = DateTime.Now;

                _postService.Save(post);

                return RedirectToAction("Index");
            }

            return View();
        }
コード例 #2
0
 public void DeleteComment(Post post, ObjectId commentID)
 {
     Context.Post.DeleteComment(post, commentID);
 }
コード例 #3
0
 public void Save(Post post)
 {
     Context.Post.Update(post);
 }
コード例 #4
0
 public void Delete(Post post)
 {
     Context.Post.Delete(post.PostId);
 }