public CommentReplyConfirmationDto Update(Guid id, CommentReplyCreateDto dto)
        {
            var commentReply = _context.CommentReplies.FirstOrDefault(e => e.Id == id);

            if (commentReply == null)
            {
                throw new BusinessException("Comment reply with provided id does not exist");
            }

            User user = MockedData.Users.FirstOrDefault(e => e.Id == dto.UserId);

            if (user == null)
            {
                throw new BusinessException("User does not exit");
            }

            commentReply.Content   = dto.Content;
            commentReply.UserId    = dto.UserId;
            commentReply.CommentId = dto.CommentId;

            _context.SaveChanges();

            _logger.Log("Comment reply updated");

            return(_mapper.Map <CommentReplyConfirmationDto>(commentReply));
        }
        public CommentReplyConfirmationDto Create(CommentReplyCreateDto dto)
        {
            User user = MockedData.Users.FirstOrDefault(e => e.Id == dto.UserId);

            if (user == null)
            {
                throw new BusinessException("User does not exit");
            }

            CommentReply commentReply = new CommentReply()
            {
                Id        = Guid.NewGuid(),
                Content   = dto.Content,
                CreatedAt = DateTime.UtcNow,
                UserId    = dto.UserId,
                CommentId = dto.CommentId
            };

            _context.CommentReplies.Add(commentReply);
            _context.SaveChanges();

            _logger.Log("Comment reply created");

            return(_mapper.Map <CommentReplyConfirmationDto>(commentReply));
        }
        public ActionResult PutCommentReplay(Guid id, CommentReplyCreateDto dto)
        {
            var entity = _repository.Update(id, dto);

            return(Ok(entity));
        }
        public ActionResult PostCommentReplay([FromBody] CommentReplyCreateDto dto)
        {
            var entity = _repository.Create(dto);

            return(Ok(entity));
        }