Exemplo n.º 1
0
 public long Count(SearchUserEntity SearchUserEntity)
 {
     if (SearchUserEntity == null) SearchUserEntity = new SearchUserEntity();
     IQueryable<User> Users = context.Users;
     Apply(Users, SearchUserEntity);
     return Users.Count();
 }
Exemplo n.º 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));
     }
 }
Exemplo n.º 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();
 }
Exemplo n.º 4
0
 public List <UserEntity> List(SearchUserEntity SearchUserEntity)
 {
     return(UserService.List(SearchUserEntity));
 }
Exemplo n.º 5
0
 public long Count(SearchUserEntity SearchUserEntity)
 {
     return(UserService.Count(SearchUserEntity));
 }