コード例 #1
0
        public IActionResult DeleteComment([FromForm] int Id)
        {
            bool deletedComment = _commentService.DeleteComment(Id);

            if (deletedComment)
            {
                return(Json(new { status = 200, message = "Delete complete" }));
            }
            return(Json(new { status = 500, message = "Delete failed" }));
        }
コード例 #2
0
        public IActionResult DeleteComment([FromRoute] Guid commentId)
        {
            var result = _commentLogic.DeleteComment(commentId);

            if (result == false)
            {
                return(NotFound());
            }
            return(Ok());
        }
コード例 #3
0
 public void DeleteComment(int commentId)
 {
     _commentLogic.DeleteComment(commentId);
 }
コード例 #4
0
ファイル: CommentController.cs プロジェクト: Gdyku/WebApi
 public async Task DeleteCommentAsync(Guid ID)
 {
     await _commentLogic.DeleteComment(ID);
 }