public async Task<IActionResult> Delete(ProductComment productComment)
        {
            var result = await _productCommentService.Delete(productComment);
            if (result.Success)
            {
                return Ok(result);
            }

            return BadRequest(result);
        }
示例#2
0
        /// <summary>
        /// 删除评论
        /// </summary>
        /// <param name="id">评论ID</param>
        /// <returns></returns>

        public HttpResponseMessage Delete(int id)
        {
            var entity = _productCommentService.GetProductCommentById(id);

            if (entity == null)
            {
                return(PageHelper.toJson(PageHelper.ReturnValue(false, "没有该评论!")));
            }
            if (_productCommentService.Delete(entity))
            {
                return(PageHelper.toJson(PageHelper.ReturnValue(true, "删除成功!")));
            }
            return(PageHelper.toJson(PageHelper.ReturnValue(true, "删除失败!")));
        }