public async Task <PagedResultDto <CourseCategoryListDto> > GetPagedCategory(GetCourseCategorysInput input)
        {
            var query = _categoryManager.QueryAsNoTracking

                        //模糊搜索名称
                        .WhereIf(!input.FilterText.IsNullOrWhiteSpace(), a => a.Name.Contains(input.FilterText))
                        //模糊搜索编码
                        .WhereIf(!input.FilterText.IsNullOrWhiteSpace(), a => a.Code.Contains(input.FilterText))
                        //模糊搜索图片路径
                        .WhereIf(!input.FilterText.IsNullOrWhiteSpace(), a => a.ImgUrl.Contains(input.FilterText))
            ;
            // TODO:根据传入的参数添加过滤条件

            var count = await query.CountAsync();

            var courseCategoryList = await query
                                     .OrderBy(input.Sorting).AsNoTracking()
                                     .PageBy(input)
                                     .ToListAsync();

            var courseCategoryListDtos = ObjectMapper.Map <List <CourseCategoryListDto> >(courseCategoryList);

            return(new PagedResultDto <CourseCategoryListDto>(count, courseCategoryListDtos));
        }
        public async Task <PagedResultDto <TreeMemberListDto> > GetPagedCourseListInCategoryAsync(GetCourseCategorysInput input)
        {
            var courseQuery = _courseManager.QueryAsNoTracking
                              .WhereIf(!input.FilterText.IsNullOrWhiteSpace(), r => r.Title.Contains(input.FilterText));

            var query = from courseCate in _courseToCourseCategoryManager.QueryAsNoTracking
                        join cate in _categoryManager.QueryAsNoTracking on courseCate.CourseCategoryId equals cate.Id
                        join course in courseQuery on courseCate.CourseId equals course.Id
                        where courseCate.CourseCategoryId == input.Id
                        select new
            {
                courseCate,
                course
            };

            var totalCount = await query.CountAsync();

            var items = await query.OrderBy(input.Sorting).PageBy(input).ToListAsync();

            return(new PagedResultDto <TreeMemberListDto>(
                       totalCount,
                       items.Select(item =>
            {
                var dto = new TreeMemberListDto
                {
                    Id = item.course.Id,
                    Name = item.course.Title,
                    AddedTime = item.courseCate.CreationTime
                };

                return dto;
            }).ToList()));
        }