public ActionResult CreateComment(CommentCreateModel model)
 {
     if (ModelState.IsValid)
     {
         var comment = model.ConvertToComment();
         comment.Id = CommentHelper.CreateComment(comment);
         return(PartialView("_Comment", new CommentViewModel(comment)));
     }
     return(Json(new { error = CommentHelper.BuildErrorMessage(ModelState) }));
 }
 static void DeleteComment(Document document)
 {
     #region #DeleteComment
     CommentHelper.CreateComment(document);
     int commentCount = document.Comments.Count;
     if (document.Comments.Count > 0)
     {
         // Uncomment the line below to delete a comment.
         //document.Comments.Remove(document.Comments[0]);
     }
     #endregion #DeleteComment
 }