Пример #1
0
        public JsonResult AddComment(string content, int houseId, int userId)
        {
            bool   reasult = _commentApplication.AddComment(content, houseId, userId);
            string message = null;

            if (reasult == false)
            {
                message = "失败";
                return(Json(message));
            }
            else
            {
                message = "成功";
                return(Json(message));
            }
        }
Пример #2
0
 public IActionResult OnPost(AddComment comment)
 {
     _commentApplication.AddComment(comment);
     return(RedirectToPage("Single", new { id = comment.ArticleId }));
 }
Пример #3
0
        public IActionResult OnPost(AddComment comment, string productSlug)
        {
            var operationResult = _commentApplication.AddComment(comment);

            return(RedirectToPage("Product", new { id = productSlug }));
        }
        public IActionResult OnPost(AddComment command, string Slug)
        {
            _commentApplication.AddComment(command);

            return(RedirectToPage("/Product", new { Id = Slug }));
        }