Browse Source

Add `orderby` and `take`.

pull/15402/head
maliming 4 years ago
parent
commit
6253049066
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 2
      modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Authorizations/EfCoreOpenIddictAuthorizationRepository.cs
  2. 2
      modules/openiddict/src/Volo.Abp.OpenIddict.MongoDB/Volo/Abp/OpenIddict/Authorizations/MongoOpenIddictAuthorizationRepository.cs

2
modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Authorizations/EfCoreOpenIddictAuthorizationRepository.cs

@ -89,6 +89,6 @@ public class EfCoreOpenIddictAuthorizationRepository : EfCoreRepository<IOpenIdd
where authorization.CreationDate < date
where authorization.Status != OpenIddictConstants.Statuses.Valid ||
(authorization.Type == OpenIddictConstants.AuthorizationTypes.AdHoc && authorizationToken == null)
select authorization).ToListAsync(cancellationToken: cancellationToken);
select authorization).OrderBy(x => x.Id).Take(count).ToListAsync(cancellationToken: cancellationToken);
}
}

2
modules/openiddict/src/Volo.Abp.OpenIddict.MongoDB/Volo/Abp/OpenIddict/Authorizations/MongoOpenIddictAuthorizationRepository.cs

@ -77,6 +77,8 @@ public class MongoOpenIddictAuthorizationRepository : MongoDbRepository<OpenIddi
.Where(x => x.CreationDate < date)
.Where(x => x.Status != OpenIddictConstants.Statuses.Valid ||
(x.Type == OpenIddictConstants.AuthorizationTypes.AdHoc && !tokens.Contains(x.Id)))
.OrderBy(x => x.Id)
.Take(count)
.ToListAsync(cancellationToken: cancellationToken);
}
}

Loading…
Cancel
Save