コード例 #1
0
        public IActionResult DeleteComment([FromRoute] Guid activityId, [FromRoute] int commentId)
        {
            if (!_activityRepository.ActivityExists(activityId))
            {
                return(NotFound("活动不存在"));
            }
            var comment = _activityRepository.GetComment(commentId);

            _activityRepository.DeleteComment(comment);
            _activityRepository.Save();
            return(NoContent());
        }