예제 #1
0
        public IActionResult DeleteComment(int id)
        {
            if (_commentData.GetComment(id) != null)
            {
                _commentData.DeleteComment(id);
                return(Ok("comment Deleted"));
            }

            return(NotFound($"Comment with Id of {id} does not exist"));
        }
예제 #2
0
 public IActionResult DeleteComment(int id)
 {
     _commentData.DeleteComment(id);
     return(RedirectToAction(nameof(Index), "Home"));
 }