Exemplo n.º 1
0
        public long Count(SearchUserEntity SearchUserEntity)
        {
            if (SearchUserEntity == null)
            {
                SearchUserEntity = new SearchUserEntity();
            }
            IQueryable <User> Users = IMSContext.Users;

            Users = SearchUserEntity.ApplyTo(Users);
            return(Users.Count());
        }
Exemplo n.º 2
0
        public List <UserEntity> Get(SearchUserEntity SearchUserEntity)
        {
            if (SearchUserEntity == null)
            {
                SearchUserEntity = new SearchUserEntity();
            }
            IQueryable <User> Users = IMSContext.Users
                                      .Include(u => u.Admin)
                                      .Include(u => u.Student)
                                      .Include(u => u.Lecturer)
                                      .Include(u => u.HrEmployee);

            Users = SearchUserEntity.ApplyTo(Users);
            Users = SearchUserEntity.SkipAndTake(Users);
            return(Users.ToList().Select(u => new UserEntity(u)).ToList());
        }