Browse Source
Added `GetListByDisplayNamesAsync` to `IOrganizationUnitRepository `.
pull/21812/head
maliming
1 year ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
3 changed files with
27 additions and
0 deletions
-
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IOrganizationUnitRepository.cs
-
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreOrganizationUnitRepository.cs
-
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoOrganizationUnitRepository.cs
|
|
|
@ -47,6 +47,12 @@ public interface IOrganizationUnitRepository : IBasicRepository<OrganizationUnit |
|
|
|
CancellationToken cancellationToken = default |
|
|
|
); |
|
|
|
|
|
|
|
Task<List<OrganizationUnit>> GetListByDisplayNamesAsync( |
|
|
|
string[] displayNames, |
|
|
|
bool includeDetails = false, |
|
|
|
CancellationToken cancellationToken = default |
|
|
|
); |
|
|
|
|
|
|
|
Task<List<IdentityRole>> GetRolesAsync( |
|
|
|
OrganizationUnit organizationUnit, |
|
|
|
string sorting = null, |
|
|
|
|
|
|
|
@ -84,6 +84,17 @@ public class EfCoreOrganizationUnitRepository |
|
|
|
return await query.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<List<OrganizationUnit>> GetListByDisplayNamesAsync( |
|
|
|
string[] displayNames, |
|
|
|
bool includeDetails = false, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return await (await GetDbSetAsync()) |
|
|
|
.IncludeDetails(includeDetails) |
|
|
|
.Where(ou => displayNames.Contains(ou.DisplayName)) |
|
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<OrganizationUnit> GetAsync( |
|
|
|
string displayName, |
|
|
|
bool includeDetails = true, |
|
|
|
|
|
|
|
@ -63,6 +63,16 @@ public class MongoOrganizationUnitRepository |
|
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<List<OrganizationUnit>> GetListByDisplayNamesAsync( |
|
|
|
string[] displayNames, |
|
|
|
bool includeDetails = false, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return await (await GetMongoQueryableAsync(cancellationToken)) |
|
|
|
.Where(x => displayNames.Contains(x.DisplayName)) |
|
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<List<OrganizationUnit>> GetListAsync( |
|
|
|
string sorting = null, |
|
|
|
int maxResultCount = int.MaxValue, |
|
|
|
|