示例#1
0
        public IActionResult Create(PostCommentCreateModel model, string returnUrl = null)
        {
            if (CoreValidator.CheckIfStringIsNullOrEmpty(model.CommentText))
            {
                ModelState.AddModelError(string.Empty, "You cannot submit an empty comment!");
                return(this.ViewOrNotFound(model));
            }

            this.commentService.Create(model.CommentText, User.GetUserId(), model.Id);
            return(RedirectToAction("Index", "Users"));
        }