public IHttpActionResult GetComments(long Id) { CommentsManager comMngr = new CommentsManager(db); var comments = comMngr.FindComments(Id); return(Json(comments)); }
public IHttpActionResult AddComment(AddCommentModel comment) { if (ModelState.IsValid) { CommentsManager comMngr = new CommentsManager(db); var userId = RequestContext.Principal.Identity.GetUserId(); var result = comMngr.AddUserComment(comment, userId); var comments = comMngr.FindComments(comment.TranId); return(Json(comments)); } return(Json(false)); }