diff --git a/global.json b/global.json index 8758c819..bca075e8 100644 --- a/global.json +++ b/global.json @@ -1,8 +1,11 @@ { "tools": { - "dotnet": "3.1.201", + "dotnet": "5.0.100-preview.4.20258.7", "runtimes": { - "aspnetcore": [ "2.1.17" ] + "aspnetcore": [ + "2.1.17", + "3.1.4" + ] } }, diff --git a/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs b/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs index be963349..f56511a0 100644 --- a/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs +++ b/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs @@ -528,7 +528,7 @@ namespace OpenIddict.Core return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var resources = new HashSet(StringComparer.Ordinal); diff --git a/src/OpenIddict.EntityFramework/OpenIddictEntityFrameworkHelpers.cs b/src/OpenIddict.EntityFramework/OpenIddictEntityFrameworkHelpers.cs index 55aa6f54..d302e2e7 100644 --- a/src/OpenIddict.EntityFramework/OpenIddictEntityFrameworkHelpers.cs +++ b/src/OpenIddict.EntityFramework/OpenIddictEntityFrameworkHelpers.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using System.Threading; using JetBrains.Annotations; using OpenIddict.EntityFramework; @@ -75,7 +76,7 @@ namespace System.Data.Entity return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { foreach (var element in await source.ToListAsync(cancellationToken)) { diff --git a/src/OpenIddict.EntityFrameworkCore/OpenIddictEntityFrameworkCoreHelpers.cs b/src/OpenIddict.EntityFrameworkCore/OpenIddictEntityFrameworkCoreHelpers.cs index 868d2ad5..8acbe973 100644 --- a/src/OpenIddict.EntityFrameworkCore/OpenIddictEntityFrameworkCoreHelpers.cs +++ b/src/OpenIddict.EntityFrameworkCore/OpenIddictEntityFrameworkCoreHelpers.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using System.Threading; using JetBrains.Annotations; using Microsoft.EntityFrameworkCore.Infrastructure; @@ -134,7 +135,7 @@ namespace Microsoft.EntityFrameworkCore return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { foreach (var element in await source.ToListAsync(cancellationToken)) { diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictApplicationStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictApplicationStore.cs index b01908e2..90589a33 100644 --- a/src/OpenIddict.MongoDb/Stores/OpenIddictApplicationStore.cs +++ b/src/OpenIddict.MongoDb/Stores/OpenIddictApplicationStore.cs @@ -204,7 +204,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.ApplicationsCollectionName); @@ -233,7 +233,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.ApplicationsCollectionName); @@ -590,7 +590,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.ApplicationsCollectionName); diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictAuthorizationStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictAuthorizationStore.cs index df638351..51d17a60 100644 --- a/src/OpenIddict.MongoDb/Stores/OpenIddictAuthorizationStore.cs +++ b/src/OpenIddict.MongoDb/Stores/OpenIddictAuthorizationStore.cs @@ -162,7 +162,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.AuthorizationsCollectionName); @@ -205,7 +205,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.AuthorizationsCollectionName); @@ -255,7 +255,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.AuthorizationsCollectionName); @@ -308,7 +308,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.AuthorizationsCollectionName); @@ -343,7 +343,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.AuthorizationsCollectionName); @@ -395,7 +395,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.AuthorizationsCollectionName); @@ -657,7 +657,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.AuthorizationsCollectionName); diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictScopeStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictScopeStore.cs index 89963b85..80c25a0e 100644 --- a/src/OpenIddict.MongoDb/Stores/OpenIddictScopeStore.cs +++ b/src/OpenIddict.MongoDb/Stores/OpenIddictScopeStore.cs @@ -195,7 +195,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.ScopesCollectionName); @@ -225,7 +225,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.ScopesCollectionName); @@ -466,7 +466,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.ScopesCollectionName); diff --git a/src/OpenIddict.MongoDb/Stores/OpenIddictTokenStore.cs b/src/OpenIddict.MongoDb/Stores/OpenIddictTokenStore.cs index 67c76922..7fa9aca2 100644 --- a/src/OpenIddict.MongoDb/Stores/OpenIddictTokenStore.cs +++ b/src/OpenIddict.MongoDb/Stores/OpenIddictTokenStore.cs @@ -158,7 +158,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.TokensCollectionName); @@ -201,7 +201,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.TokensCollectionName); @@ -251,7 +251,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.TokensCollectionName); @@ -283,7 +283,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.TokensCollectionName); @@ -312,7 +312,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.TokensCollectionName); @@ -385,7 +385,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.TokensCollectionName); @@ -718,7 +718,7 @@ namespace OpenIddict.MongoDb return ExecuteAsync(cancellationToken); - async IAsyncEnumerable ExecuteAsync(CancellationToken cancellationToken) + async IAsyncEnumerable ExecuteAsync([EnumeratorCancellation] CancellationToken cancellationToken) { var database = await Context.GetDatabaseAsync(cancellationToken); var collection = database.GetCollection(Options.CurrentValue.TokensCollectionName);