public async Task <CommentsListVM> GetCommentsUser(Guid userId, int countEntity, int page) { if (countEntity <= 0 || page <= 0) { CommentsListVM listEmpty = new CommentsListVM(); return(listEmpty); } else { return(await _commentStorage.GetCommentsUser(userId, countEntity, page)); } }
public async Task <CommentsListVM> GetCommentsUser(Guid userId, int count, int page) { var countEntity = await _commentRepository.CountUserId(userId); var comments = new CommentsListVM { CountPage = countEntity % count == 0 ? countEntity / count : (countEntity / count) + 1, CommentsList = await _commentRepository.GetCommentsUser(userId, count, page) }; return(comments); }