Example #1
0
        public IActionResult CreateComment(int toothId, [FromBody] CreateCommentViewModel createComment)
        {
            if (toothId != createComment.ToothId)
            {
                return(BadRequest());
            }

            if (!_toothService.Exist(toothId))
            {
                return(NotFound());
            }

            var commentDTO = CommentMapper.CreateCommentVMToDTO(createComment);

            _commentService.Create(commentDTO);

            return(Ok(ModelState));
        }