public async Task AddAuthorComment(AuthorCommentCreateModel authorCommentCreateModel, string userId) { if (authorCommentCreateModel == null || authorCommentCreateModel.AuthorId.IsNullOrEmpty() || authorCommentCreateModel.Comment.IsNullOrEmpty()) { throw new CustomException("Некоректные данные"); } var model = _mapper.Map <AuthorComment>(authorCommentCreateModel); model.UserId = userId; await _commentRepository.AddAuthorComment(model); }