diff --git a/src/OpenIddict.Abstractions/Managers/IOpenIddictApplicationManager.cs b/src/OpenIddict.Abstractions/Managers/IOpenIddictApplicationManager.cs
index be956652..3398b12f 100644
--- a/src/OpenIddict.Abstractions/Managers/IOpenIddictApplicationManager.cs
+++ b/src/OpenIddict.Abstractions/Managers/IOpenIddictApplicationManager.cs
@@ -142,7 +142,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, IQueryable> query, CancellationToken cancellationToken = default);
///
@@ -157,7 +157,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken = default);
diff --git a/src/OpenIddict.Abstractions/Managers/IOpenIddictAuthorizationManager.cs b/src/OpenIddict.Abstractions/Managers/IOpenIddictAuthorizationManager.cs
index 44d5e22f..84ea62e7 100644
--- a/src/OpenIddict.Abstractions/Managers/IOpenIddictAuthorizationManager.cs
+++ b/src/OpenIddict.Abstractions/Managers/IOpenIddictAuthorizationManager.cs
@@ -192,7 +192,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, IQueryable> query, CancellationToken cancellationToken = default);
///
@@ -207,7 +207,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken = default);
diff --git a/src/OpenIddict.Abstractions/Managers/IOpenIddictScopeManager.cs b/src/OpenIddict.Abstractions/Managers/IOpenIddictScopeManager.cs
index bcfb9cd7..8e5d1ec2 100644
--- a/src/OpenIddict.Abstractions/Managers/IOpenIddictScopeManager.cs
+++ b/src/OpenIddict.Abstractions/Managers/IOpenIddictScopeManager.cs
@@ -126,7 +126,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, IQueryable> query, CancellationToken cancellationToken = default);
///
@@ -141,7 +141,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken = default);
diff --git a/src/OpenIddict.Abstractions/Managers/IOpenIddictTokenManager.cs b/src/OpenIddict.Abstractions/Managers/IOpenIddictTokenManager.cs
index d3d2cb43..e48137d8 100644
--- a/src/OpenIddict.Abstractions/Managers/IOpenIddictTokenManager.cs
+++ b/src/OpenIddict.Abstractions/Managers/IOpenIddictTokenManager.cs
@@ -181,7 +181,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, IQueryable> query, CancellationToken cancellationToken = default);
///
@@ -196,7 +196,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken = default);
diff --git a/src/OpenIddict.Abstractions/Stores/IOpenIddictApplicationStore.cs b/src/OpenIddict.Abstractions/Stores/IOpenIddictApplicationStore.cs
index aaf6e880..668ce829 100644
--- a/src/OpenIddict.Abstractions/Stores/IOpenIddictApplicationStore.cs
+++ b/src/OpenIddict.Abstractions/Stores/IOpenIddictApplicationStore.cs
@@ -109,7 +109,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken);
diff --git a/src/OpenIddict.Abstractions/Stores/IOpenIddictAuthorizationStore.cs b/src/OpenIddict.Abstractions/Stores/IOpenIddictAuthorizationStore.cs
index acd76f6a..43ce30f6 100644
--- a/src/OpenIddict.Abstractions/Stores/IOpenIddictAuthorizationStore.cs
+++ b/src/OpenIddict.Abstractions/Stores/IOpenIddictAuthorizationStore.cs
@@ -158,7 +158,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken);
diff --git a/src/OpenIddict.Abstractions/Stores/IOpenIddictScopeStore.cs b/src/OpenIddict.Abstractions/Stores/IOpenIddictScopeStore.cs
index 829404da..4f9f6ed7 100644
--- a/src/OpenIddict.Abstractions/Stores/IOpenIddictScopeStore.cs
+++ b/src/OpenIddict.Abstractions/Stores/IOpenIddictScopeStore.cs
@@ -109,7 +109,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken);
diff --git a/src/OpenIddict.Abstractions/Stores/IOpenIddictTokenStore.cs b/src/OpenIddict.Abstractions/Stores/IOpenIddictTokenStore.cs
index 33f55b65..c8e068e3 100644
--- a/src/OpenIddict.Abstractions/Stores/IOpenIddictTokenStore.cs
+++ b/src/OpenIddict.Abstractions/Stores/IOpenIddictTokenStore.cs
@@ -163,7 +163,7 @@ namespace OpenIddict.Abstractions
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- ValueTask GetAsync(
+ ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken);
diff --git a/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs b/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
index b0475f46..b9e15875 100644
--- a/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
+++ b/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
@@ -430,7 +430,7 @@ namespace OpenIddict.Core
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- public virtual ValueTask GetAsync(
+ public virtual ValueTask GetAsync(
Func, IQueryable> query, CancellationToken cancellationToken = default)
{
if (query is null)
@@ -453,7 +453,7 @@ namespace OpenIddict.Core
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- public virtual ValueTask GetAsync(
+ public virtual ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken = default)
{
@@ -1562,11 +1562,11 @@ namespace OpenIddict.Core
=> FindByRedirectUriAsync(address, cancellationToken);
///
- ValueTask IOpenIddictApplicationManager.GetAsync(Func, IQueryable> query, CancellationToken cancellationToken)
+ ValueTask IOpenIddictApplicationManager.GetAsync(Func, IQueryable> query, CancellationToken cancellationToken) where TResult : default
=> GetAsync(query, cancellationToken);
///
- ValueTask IOpenIddictApplicationManager.GetAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken)
+ ValueTask IOpenIddictApplicationManager.GetAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken) where TResult : default
=> GetAsync(query, state, cancellationToken);
///
diff --git a/src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs b/src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs
index 2ee0b741..f6444ae2 100644
--- a/src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs
+++ b/src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs
@@ -641,7 +641,7 @@ namespace OpenIddict.Core
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- public virtual ValueTask GetAsync(
+ public virtual ValueTask GetAsync(
Func, IQueryable> query, CancellationToken cancellationToken = default)
{
if (query is null)
@@ -664,7 +664,7 @@ namespace OpenIddict.Core
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- public virtual ValueTask GetAsync(
+ public virtual ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken = default)
{
@@ -1245,11 +1245,11 @@ namespace OpenIddict.Core
=> GetApplicationIdAsync((TAuthorization) authorization, cancellationToken);
///
- ValueTask IOpenIddictAuthorizationManager.GetAsync(Func, IQueryable> query, CancellationToken cancellationToken)
+ ValueTask IOpenIddictAuthorizationManager.GetAsync(Func, IQueryable> query, CancellationToken cancellationToken) where TResult : default
=> GetAsync(query, cancellationToken);
///
- ValueTask IOpenIddictAuthorizationManager.GetAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken)
+ ValueTask IOpenIddictAuthorizationManager.GetAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken) where TResult : default
=> GetAsync(query, state, cancellationToken);
ValueTask IOpenIddictAuthorizationManager.GetCreationDateAsync(object authorization, CancellationToken cancellationToken)
diff --git a/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs b/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs
index ea7d9ca5..be30330e 100644
--- a/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs
+++ b/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs
@@ -368,7 +368,7 @@ namespace OpenIddict.Core
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- public virtual ValueTask GetAsync(
+ public virtual ValueTask GetAsync(
Func, IQueryable> query, CancellationToken cancellationToken = default)
{
if (query is null)
@@ -391,7 +391,7 @@ namespace OpenIddict.Core
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- public virtual ValueTask GetAsync(
+ public virtual ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken = default)
{
@@ -1000,11 +1000,11 @@ namespace OpenIddict.Core
=> FindByResourceAsync(resource, cancellationToken);
///
- ValueTask IOpenIddictScopeManager.GetAsync(Func, IQueryable> query, CancellationToken cancellationToken)
+ ValueTask IOpenIddictScopeManager.GetAsync(Func, IQueryable> query, CancellationToken cancellationToken) where TResult : default
=> GetAsync(query, cancellationToken);
///
- ValueTask IOpenIddictScopeManager.GetAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken)
+ ValueTask IOpenIddictScopeManager.GetAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken) where TResult : default
=> GetAsync(query, state, cancellationToken);
///
diff --git a/src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs b/src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs
index 65caa516..7f52d3c0 100644
--- a/src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs
+++ b/src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs
@@ -607,7 +607,7 @@ namespace OpenIddict.Core
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- public virtual ValueTask GetAsync(
+ public virtual ValueTask GetAsync(
Func, IQueryable> query, CancellationToken cancellationToken = default)
{
if (query is null)
@@ -630,7 +630,7 @@ namespace OpenIddict.Core
/// A that can be used to monitor the asynchronous operation,
/// whose result returns the first element returned when executing the query.
///
- public virtual ValueTask GetAsync(
+ public virtual ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken = default)
{
@@ -1371,11 +1371,11 @@ namespace OpenIddict.Core
=> GetApplicationIdAsync((TToken) token, cancellationToken);
///
- ValueTask IOpenIddictTokenManager.GetAsync(Func, IQueryable> query, CancellationToken cancellationToken)
+ ValueTask IOpenIddictTokenManager.GetAsync(Func, IQueryable> query, CancellationToken cancellationToken) where TResult : default
=> GetAsync(query, cancellationToken);
///
- ValueTask IOpenIddictTokenManager.GetAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken)
+ ValueTask IOpenIddictTokenManager.GetAsync(Func, TState, IQueryable> query, TState state, CancellationToken cancellationToken) where TResult : default
=> GetAsync(query, state, cancellationToken);
///
diff --git a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkApplicationStore.cs b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkApplicationStore.cs
index 7a8eda0a..461f217b 100644
--- a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkApplicationStore.cs
+++ b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkApplicationStore.cs
@@ -311,7 +311,7 @@ namespace OpenIddict.EntityFramework
}
///
- public virtual async ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken)
{
diff --git a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkAuthorizationStore.cs b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkAuthorizationStore.cs
index d8b7ab19..c6294e68 100644
--- a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkAuthorizationStore.cs
+++ b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkAuthorizationStore.cs
@@ -399,7 +399,7 @@ namespace OpenIddict.EntityFramework
}
///
- public virtual async ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken)
{
diff --git a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkScopeStore.cs b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkScopeStore.cs
index 11fb520e..c972906e 100644
--- a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkScopeStore.cs
+++ b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkScopeStore.cs
@@ -216,7 +216,7 @@ namespace OpenIddict.EntityFramework
}
///
- public virtual async ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken)
{
diff --git a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkTokenStore.cs b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkTokenStore.cs
index 66598ec4..5d79a185 100644
--- a/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkTokenStore.cs
+++ b/src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkTokenStore.cs
@@ -339,7 +339,7 @@ namespace OpenIddict.EntityFramework
}
///
- public virtual async ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken)
{
diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreApplicationStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreApplicationStore.cs
index 2ce6182e..18abee91 100644
--- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreApplicationStore.cs
+++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreApplicationStore.cs
@@ -355,7 +355,7 @@ namespace OpenIddict.EntityFrameworkCore
}
///
- public virtual async ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken)
{
diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs
index 265b2d8e..80b43429 100644
--- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs
+++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs
@@ -466,7 +466,7 @@ namespace OpenIddict.EntityFrameworkCore
}
///
- public virtual async ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken)
{
diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreScopeStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreScopeStore.cs
index df777826..956404b2 100644
--- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreScopeStore.cs
+++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreScopeStore.cs
@@ -232,7 +232,7 @@ namespace OpenIddict.EntityFrameworkCore
}
///
- public virtual async ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken)
{
diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreTokenStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreTokenStore.cs
index 7ad98c28..0d82474e 100644
--- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreTokenStore.cs
+++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreTokenStore.cs
@@ -390,7 +390,7 @@ namespace OpenIddict.EntityFrameworkCore
}
///
- public virtual ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken)
{
@@ -399,10 +399,9 @@ namespace OpenIddict.EntityFrameworkCore
throw new ArgumentNullException(nameof(query));
}
- return new ValueTask(query(
- Tokens.Include(token => token.Application)
- .Include(token => token.Authorization)
- .AsTracking(), state).FirstOrDefaultAsync(cancellationToken));
+ return await query(Tokens.Include(token => token.Application)
+ .Include(token => token.Authorization)
+ .AsTracking(), state).FirstOrDefaultAsync(cancellationToken);
}
///
diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbApplicationStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbApplicationStore.cs
index 68d83e06..565ee6e2 100644
--- a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbApplicationStore.cs
+++ b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbApplicationStore.cs
@@ -194,7 +194,7 @@ namespace OpenIddict.MongoDb
}
///
- public virtual async ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken)
{
diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbAuthorizationStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbAuthorizationStore.cs
index edb501ed..288cd893 100644
--- a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbAuthorizationStore.cs
+++ b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbAuthorizationStore.cs
@@ -349,7 +349,7 @@ namespace OpenIddict.MongoDb
}
///
- public virtual async ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func, TState, IQueryable> query,
TState state, CancellationToken cancellationToken)
{
diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbScopeStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbScopeStore.cs
index ee97b991..58f44181 100644
--- a/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbScopeStore.cs
+++ b/src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbScopeStore.cs
@@ -183,7 +183,7 @@ namespace OpenIddict.MongoDb
}
///
- public virtual async ValueTask GetAsync(
+ public virtual async ValueTask GetAsync(
Func