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 })); }
public HttpResponseMessage NewComment(NewCommentAPIModel objData) { BlogServices.AddComment(objData.Name, objData.Content, objData.PostId); return(Request.CreateResponse(HttpStatusCode.OK, new { Data = objData.PostId })); }