Exemplo n.º 1
0
 /// <summary>
 /// 输出模型
 /// </summary>
 /// <param name="YaeherUserDto"></param>
 /// <param name="YaeherUserInfo"></param>
 public YaeherUserOut(PagedResultDto <YaeherUser> YaeherUserDto, YaeherUserIn YaeherUserInfo)
 {
     Items          = YaeherUserDto.Items;
     TotalCount     = YaeherUserDto.TotalCount;
     TotalPage      = YaeherUserDto.TotalCount / YaeherUserInfo.MaxResultCount;
     SkipCount      = YaeherUserInfo.SkipCount;
     MaxResultCount = YaeherUserInfo.MaxResultCount;
 }
Exemplo n.º 2
0
        public async Task <PagedResultDto <YaeherUser> > YaeherUserPage(YaeherUserIn YaeherUserInfo)
        {
            //初步过滤
            var query = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(YaeherUserInfo.Expression);
            //获取总数
            var tasksCount = query.Count();
            //获取总数
            var totalpage      = tasksCount / YaeherUserInfo.MaxResultCount;
            var YaeherUserList = await query.PageBy(YaeherUserInfo.SkipTotal, YaeherUserInfo.MaxResultCount).ToListAsync();

            return(new PagedResultDto <YaeherUser>(tasksCount, YaeherUserList.MapTo <List <YaeherUser> >()));
        }
Exemplo n.º 3
0
        public async Task <List <YaeherUser> > YaeherUserList(YaeherUserIn YaeherUserInfo)
        {
            var query = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(YaeherUserInfo.Expression);

            return(await query.ToListAsync());
        }