|
|
|
@ -14,16 +14,26 @@ namespace Volo.Abp.IdentityServer.MongoDB |
|
|
|
{ |
|
|
|
public class MongoClientRepository : MongoDbRepository<IAbpIdentityServerMongoDbContext, Client, Guid>, IClientRepository |
|
|
|
{ |
|
|
|
public MongoClientRepository(IMongoDbContextProvider<IAbpIdentityServerMongoDbContext> dbContextProvider) : base(dbContextProvider) |
|
|
|
public MongoClientRepository( |
|
|
|
IMongoDbContextProvider<IAbpIdentityServerMongoDbContext> dbContextProvider |
|
|
|
) : base( |
|
|
|
dbContextProvider) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<Client> FindByCliendIdAsync(string clientId, bool includeDetails = true, CancellationToken cancellationToken = default) |
|
|
|
public virtual async Task<Client> FindByCliendIdAsync( |
|
|
|
string clientId, |
|
|
|
bool includeDetails = true, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return await GetMongoQueryable().FirstOrDefaultAsync(x => x.ClientId == clientId, GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<List<Client>> GetListAsync(string sorting, int skipCount, int maxResultCount, bool includeDetails = false, |
|
|
|
public virtual async Task<List<Client>> GetListAsync( |
|
|
|
string sorting, |
|
|
|
int skipCount, |
|
|
|
int maxResultCount, |
|
|
|
bool includeDetails = false, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return await GetMongoQueryable() |
|
|
|
@ -33,6 +43,16 @@ namespace Volo.Abp.IdentityServer.MongoDB |
|
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<List<string>> GetAllDistinctAllowedCorsOriginsAsync( |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return await GetMongoQueryable() |
|
|
|
.SelectMany(x => x.AllowedCorsOrigins) |
|
|
|
.Select(y => y.Origin) |
|
|
|
.Distinct() |
|
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task<long> GetTotalCount() |
|
|
|
{ |
|
|
|
return await GetCountAsync(); |
|
|
|
|