|
|
|
@ -14,13 +14,13 @@ namespace Volo.Abp.Identity.MongoDB |
|
|
|
{ |
|
|
|
public class MongoIdentityRoleRepository : MongoDbRepository<IAbpIdentityMongoDbContext, IdentityRole, Guid>, IIdentityRoleRepository |
|
|
|
{ |
|
|
|
public MongoIdentityRoleRepository(IMongoDbContextProvider<IAbpIdentityMongoDbContext> dbContextProvider) |
|
|
|
public MongoIdentityRoleRepository(IMongoDbContextProvider<IAbpIdentityMongoDbContext> dbContextProvider) |
|
|
|
: base(dbContextProvider) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<IdentityRole> FindByNormalizedNameAsync( |
|
|
|
string normalizedRoleName, |
|
|
|
string normalizedRoleName, |
|
|
|
bool includeDetails = true, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
@ -28,13 +28,17 @@ namespace Volo.Abp.Identity.MongoDB |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<List<IdentityRole>> GetListAsync( |
|
|
|
string sorting = null, |
|
|
|
int maxResultCount = int.MaxValue, |
|
|
|
int skipCount = 0, |
|
|
|
string sorting = null, |
|
|
|
int maxResultCount = int.MaxValue, |
|
|
|
int skipCount = 0, |
|
|
|
string filter = null, |
|
|
|
bool includeDetails = false, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return await GetMongoQueryable() |
|
|
|
.WhereIf(filter != null, |
|
|
|
x => x.Name.Contains(filter) || |
|
|
|
x.NormalizedName.Contains(filter)) |
|
|
|
.OrderBy(sorting ?? nameof(IdentityRole.Name)) |
|
|
|
.As<IMongoQueryable<IdentityRole>>() |
|
|
|
.PageBy<IdentityRole, IMongoQueryable<IdentityRole>>(skipCount, maxResultCount) |
|
|
|
|