Пример #1
0
        public async Task <ActionResult> NewComment(NewCommentModel model)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("Post", new { id = model.PostId }));
            }

            BlogServices.AddComment(User.Identity.Name, model.Content, model.PostId);

            return(RedirectToAction("Post", new { id = model.PostId }));
        }
Пример #2
0
 public HttpResponseMessage NewComment(NewCommentAPIModel objData)
 {
     BlogServices.AddComment(objData.Name, objData.Content, objData.PostId);
     return(Request.CreateResponse(HttpStatusCode.OK, new { Data = objData.PostId }));
 }