Example #1
0
        public IEnumerable <UserInfo> GetPagedList(UserInfoSearch userInfoSearch, out int totalCount)
        {
            Expression <Func <UserInfo, bool> > search = Predicates.Begin <UserInfo>(true);

            if (!string.IsNullOrEmpty(userInfoSearch.Name))
            {
                search.And(m => m.Name.Contains(userInfoSearch.Name));
            }
            if (userInfoSearch.CreateTimeStart != null)
            {
                search.And(m => m.CreateTime > userInfoSearch.CreateTimeStart);
            }
            if (userInfoSearch.CreateTimeEnd != null)
            {
                search.And(m => m.CreateTime < userInfoSearch.CreateTimeEnd);
            }
            return(_UserInfoRepository.GetPagedList(search, m => m.CreateTime, true, 1, 10, out totalCount).ToList());
        }