Browse Source

add paged

pull/5338/head
liangshiwei 6 years ago
parent
commit
f5b6ef2388
  1. 8
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IOrganizationUnitRepository.cs
  2. 10
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreOrganizationUnitRepository.cs
  3. 10
      modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoOrganizationUnitRepository.cs

8
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IOrganizationUnitRepository.cs

@ -57,8 +57,10 @@ namespace Volo.Abp.Identity
Task<List<IdentityRole>> GetUnaddedRolesAsync(
OrganizationUnit organizationUnit,
string filter = null,
string sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,
string filter = null,
bool includeDetails = false,
CancellationToken cancellationToken = default
);
@ -81,8 +83,10 @@ namespace Volo.Abp.Identity
Task<List<IdentityUser>> GetUnaddedUsersAsync(
OrganizationUnit organizationUnit,
string filter = null,
string sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,
string filter = null,
bool includeDetails = false,
CancellationToken cancellationToken = default
);

10
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreOrganizationUnitRepository.cs

@ -114,8 +114,10 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
public virtual async Task<List<IdentityRole>> GetUnaddedRolesAsync(
OrganizationUnit organizationUnit,
string filter = null,
string sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,
string filter = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@ -126,6 +128,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
.IncludeDetails(includeDetails)
.WhereIf(!filter.IsNullOrWhiteSpace(), r => r.Name.Contains(filter))
.OrderBy(sorting ?? nameof(IdentityRole.Name))
.PageBy(skipCount, maxResultCount)
.ToListAsync(cancellationToken);
}
@ -157,8 +160,10 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
public virtual async Task<List<IdentityUser>> GetUnaddedUsersAsync(
OrganizationUnit organizationUnit,
string filter = null,
string sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,
string filter = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@ -181,6 +186,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
return await query
.IncludeDetails(includeDetails)
.OrderBy(sorting ?? nameof(IdentityUser.Name))
.PageBy(skipCount, maxResultCount)
.ToListAsync(cancellationToken);
}

10
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoOrganizationUnitRepository.cs

@ -109,8 +109,10 @@ namespace Volo.Abp.Identity.MongoDB
public async Task<List<IdentityRole>> GetUnaddedRolesAsync(
OrganizationUnit organizationUnit,
string filter = null,
string sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,
string filter = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@ -120,6 +122,7 @@ namespace Volo.Abp.Identity.MongoDB
.WhereIf(!filter.IsNullOrWhiteSpace(), r => r.Name.Contains(filter))
.OrderBy(sorting ?? nameof(IdentityRole.Name))
.As<IMongoQueryable<IdentityRole>>()
.PageBy<IdentityRole, IMongoQueryable<IdentityRole>>(skipCount, maxResultCount)
.ToListAsync(cancellationToken);
}
@ -153,8 +156,10 @@ namespace Volo.Abp.Identity.MongoDB
public async Task<List<IdentityUser>> GetUnaddedUsersAsync(
OrganizationUnit organizationUnit,
string filter = null,
string sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,
string filter = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@ -169,6 +174,7 @@ namespace Volo.Abp.Identity.MongoDB
)
.OrderBy(sorting ?? nameof(IdentityUser.UserName))
.As<IMongoQueryable<IdentityUser>>()
.PageBy<IdentityUser, IMongoQueryable<IdentityUser>>(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}

Loading…
Cancel
Save