private IEnumerable <UserViewModel> GetCustomers() { IEnumerable <UserEntity> list = _membershipSer.Fetch(null); IList <UserViewModel> listV = new List <UserViewModel>(); list.ToList <UserEntity>().ForEach(x => { listV.Add(Mapper.Map <UserEntity, UserViewModel>(x)); }); return(listV); }
// // GET: /Pager/ public ActionResult Index(int?page) { int currentPageIndex = page.HasValue ? page.Value - 1 : 0; IMembershipServiceInModule membershipService = DependencyResolver.Current.GetService <IMembershipServiceInModule>(); Pagination pagination = new Pagination(currentPageIndex); Expression <Func <UserEntity, bool> > pre = PredicateExtensions.True <UserEntity>(); var allUsers = membershipService.Fetch((x => ((x.NormalizedUserName == "" && x.Id == 1) || x.Password == "")), (x => x.Asc(d => d.Password, d => d.Password)), pagination); return(View(allUsers.ToPagedList(currentPageIndex, 5, 10))); }