Skip to content

Commit

Permalink
Merge pull request #7151 from abpframework/liangshiwei/identity-patch-1
Browse files Browse the repository at this point in the history
Use async repository method in IdentityServer module
  • Loading branch information
maliming authored Jan 12, 2021
2 parents 337643b + 9f3cfda commit 05a966e
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public virtual async Task<List<ApiResource>> GetListAsync(

public async Task<long> GetCountAsync(string filter = null, CancellationToken cancellationToken = default)
{
return await DbSet
return await (await GetDbSetAsync())
.WhereIf(!filter.IsNullOrWhiteSpace(),
x => x.Name.Contains(filter) ||
x.Description.Contains(filter) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task<List<ApiScope>> GetListAsync(string sorting, int skipCount, in

public async Task<long> GetCountAsync(string filter = null, CancellationToken cancellationToken = default)
{
return await DbSet
return await (await GetDbSetAsync())
.WhereIf(!filter.IsNullOrWhiteSpace(),
x => x.Name.Contains(filter) ||
x.Description.Contains(filter) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public virtual async Task<List<Client>> GetListAsync(

public async Task<long> GetCountAsync(string filter = null, CancellationToken cancellationToken = default)
{
return await DbSet
return await (await GetDbSetAsync())
.WhereIf(!filter.IsNullOrWhiteSpace(), x => x.ClientId.Contains(filter))
.LongCountAsync(GetCancellationToken(cancellationToken));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public virtual async Task<List<IdentityResource>> GetListAsync(string sorting, i

public async Task<long> GetCountAsync(string filter = null, CancellationToken cancellationToken = default)
{
return await DbSet
return await (await GetDbSetAsync())
.WhereIf(!filter.IsNullOrWhiteSpace(),
x => x.Name.Contains(filter) ||
x.Description.Contains(filter) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public virtual async Task<List<ApiResource>> GetListAsync(string sorting, int sk

public async Task<long> GetCountAsync(string filter = null, CancellationToken cancellationToken = default)
{
return await GetMongoQueryable()
return await (await GetMongoQueryableAsync(cancellationToken))
.WhereIf<ApiResource, IMongoQueryable<ApiResource>>(!filter.IsNullOrWhiteSpace(),
x => x.Name.Contains(filter) ||
x.Description.Contains(filter) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task<List<ApiScope>> GetListAsync(string sorting, int skipCount, in

public async Task<long> GetCountAsync(string filter = null, CancellationToken cancellationToken = default)
{
return await GetMongoQueryable()
return await (await GetMongoQueryableAsync(cancellationToken))
.WhereIf<ApiScope, IMongoQueryable<ApiScope>>(!filter.IsNullOrWhiteSpace(),
x => x.Name.Contains(filter) ||
x.Description.Contains(filter) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public virtual async Task<List<Client>> GetListAsync(

public async Task<long> GetCountAsync(string filter = null, CancellationToken cancellationToken = default)
{
return await GetMongoQueryable()
return await (await GetMongoQueryableAsync(cancellationToken))
.WhereIf<Client, IMongoQueryable<Client>>(!filter.IsNullOrWhiteSpace(),
x => x.ClientId.Contains(filter))
.LongCountAsync(GetCancellationToken(cancellationToken));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public virtual async Task<List<IdentityResource>> GetListAsync(string sorting, i

public async Task<long> GetCountAsync(string filter = null, CancellationToken cancellationToken = default)
{
return await GetMongoQueryable()
return await (await GetMongoQueryableAsync(cancellationToken))
.WhereIf<IdentityResource, IMongoQueryable<IdentityResource>>(!filter.IsNullOrWhiteSpace(),
x => x.Name.Contains(filter) ||
x.Description.Contains(filter) ||
Expand Down

0 comments on commit 05a966e

Please sign in to comment.