예제 #1
0
        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));
        }