Browse Source

Rename RoleWithUserCount with IdentityRoleWithUserCount

pull/17380/head
liangshiwei 3 years ago
parent
commit
8e092e6c52
  1. 2
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityRoleRepository.cs
  2. 4
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleWithUserCount.cs
  3. 4
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs
  4. 4
      modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityRoleRepository.cs

2
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityRoleRepository.cs

@ -14,7 +14,7 @@ public interface IIdentityRoleRepository : IBasicRepository<IdentityRole, Guid>
CancellationToken cancellationToken = default
);
Task<List<RoleWithUserCount>> GetListWithUserCountAsync(
Task<List<IdentityRoleWithUserCount>> GetListWithUserCountAsync(
string sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,

4
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/RoleWithUserCount.cs → modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityRoleWithUserCount.cs

@ -2,13 +2,13 @@ using System;
namespace Volo.Abp.Identity;
public class RoleWithUserCount
public class IdentityRoleWithUserCount
{
public IdentityRole Role { get; set; }
public long UserCount { get; set; }
public RoleWithUserCount(IdentityRole role, long userCount)
public IdentityRoleWithUserCount(IdentityRole role, long userCount)
{
Role = role;
UserCount = userCount;

4
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs

@ -28,7 +28,7 @@ public class EfCoreIdentityRoleRepository : EfCoreRepository<IIdentityDbContext,
.FirstOrDefaultAsync(r => r.NormalizedName == normalizedRoleName, GetCancellationToken(cancellationToken));
}
public async Task<List<RoleWithUserCount>> GetListWithUserCountAsync(
public async Task<List<IdentityRoleWithUserCount>> GetListWithUserCountAsync(
string sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,
@ -49,7 +49,7 @@ public class EfCoreIdentityRoleRepository : EfCoreRepository<IIdentityDbContext,
})
.ToListAsync(GetCancellationToken(cancellationToken));
return roles.Select(role => new RoleWithUserCount(role, userCount.FirstOrDefault(x => x.RoleId == role.Id)?.Count ?? 0)).ToList();
return roles.Select(role => new IdentityRoleWithUserCount(role, userCount.FirstOrDefault(x => x.RoleId == role.Id)?.Count ?? 0)).ToList();
}
public virtual async Task<List<IdentityRole>> GetListAsync(

4
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityRoleRepository.cs

@ -28,7 +28,7 @@ public class MongoIdentityRoleRepository : MongoDbRepository<IAbpIdentityMongoDb
.FirstOrDefaultAsync(r => r.NormalizedName == normalizedRoleName, GetCancellationToken(cancellationToken));
}
public async Task<List<RoleWithUserCount>> GetListWithUserCountAsync(
public async Task<List<IdentityRoleWithUserCount>> GetListWithUserCountAsync(
string sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,
@ -49,7 +49,7 @@ public class MongoIdentityRoleRepository : MongoDbRepository<IAbpIdentityMongoDb
})
.ToListAsync(GetCancellationToken(cancellationToken));
return roles.Select(role => new RoleWithUserCount(role, userCount.FirstOrDefault(x => x.RoleId == role.Id)?.Count ?? 0)).ToList();
return roles.Select(role => new IdentityRoleWithUserCount(role, userCount.FirstOrDefault(x => x.RoleId == role.Id)?.Count ?? 0)).ToList();
}
public virtual async Task<List<IdentityRole>> GetListAsync(

Loading…
Cancel
Save