Example #1
0
 public long Count(SearchUserEntity SearchUserEntity)
 {
     if (SearchUserEntity == null) SearchUserEntity = new SearchUserEntity();
     IQueryable<User> Users = context.Users;
     Apply(Users, SearchUserEntity);
     return Users.Count();
 }
Example #2
0
 private void Apply(IEnumerable<User> source, SearchUserEntity SearchUserEntity)
 {
     if (SearchUserEntity.Username != null)
     {
         source = source.Where(u =>
             u.Username.Contains(SearchUserEntity.Username) || SearchUserEntity.Username.Contains(u.Username));
     }
 }
Example #3
0
 public List<UserEntity> List(SearchUserEntity SearchUserEntity)
 {
     if (SearchUserEntity == null) SearchUserEntity = new SearchUserEntity();
     IQueryable<User> Users = context.Users
         .Include(u => u.Admin)
         .Include(u => u.Student)
         .Include(u => u.Lecturer);
         
     Apply(Users, SearchUserEntity);
     //Users = SearchUserEntity.SkipAndTake(Users);
     return Users.ToList().Select(u => new UserEntity(u)).ToList();
 }
 public List <UserEntity> List(SearchUserEntity SearchUserEntity)
 {
     return(UserService.List(SearchUserEntity));
 }
 public long Count(SearchUserEntity SearchUserEntity)
 {
     return(UserService.Count(SearchUserEntity));
 }