/// <summary>
        /// 获取WechatSubscribe的分页列表信息
        ///</summary>

        public async Task <PagedResultDto <WechatSubscribeListDto> > GetPaged(GetWechatSubscribesInput input)
        {
            var query = _entityRepository.GetAll();
            // TODO:根据传入的参数添加过滤条件


            var count = await query.CountAsync();

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

            // var entityListDtos = ObjectMapper.Map<List<WechatSubscribeListDto>>(entityList);
            var entityListDtos = entityList.MapTo <List <WechatSubscribeListDto> >();

            return(new PagedResultDto <WechatSubscribeListDto>(count, entityListDtos));
        }
示例#2
0
        /// <summary>
        /// 获取WechatSubscribe的分页列表信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <PagedResultDto <WechatSubscribeListDto> > GetPagedWechatSubscribes(GetWechatSubscribesInput input)
        {
            var query = _wechatsubscribeRepository.GetAll();
            //TODO:根据传入的参数添加过滤条件
            var wechatsubscribeCount = await query.CountAsync();

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

            //var wechatsubscribeListDtos = ObjectMapper.Map<List <WechatSubscribeListDto>>(wechatsubscribes);
            var wechatsubscribeListDtos = wechatsubscribes.MapTo <List <WechatSubscribeListDto> >();

            return(new PagedResultDto <WechatSubscribeListDto>(
                       wechatsubscribeCount,
                       wechatsubscribeListDtos
                       ));
        }