Browse Source

Backport the stores changes to OpenIddict 1.x

pull/553/head
Kévin Chalet 8 years ago
parent
commit
e25058a8dd
  1. 8
      src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
  2. 8
      src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs
  3. 8
      src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs
  4. 8
      src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs
  5. 8
      src/OpenIddict.Core/Stores/IOpenIddictApplicationStore.cs
  6. 8
      src/OpenIddict.Core/Stores/IOpenIddictAuthorizationStore.cs
  7. 8
      src/OpenIddict.Core/Stores/IOpenIddictScopeStore.cs
  8. 8
      src/OpenIddict.Core/Stores/IOpenIddictTokenStore.cs
  9. 8
      src/OpenIddict.Core/Stores/OpenIddictApplicationStore.cs
  10. 8
      src/OpenIddict.Core/Stores/OpenIddictAuthorizationStore.cs
  11. 8
      src/OpenIddict.Core/Stores/OpenIddictScopeStore.cs
  12. 8
      src/OpenIddict.Core/Stores/OpenIddictTokenStore.cs
  13. 8
      src/OpenIddict.EntityFramework/Stores/OpenIddictApplicationStore.cs
  14. 8
      src/OpenIddict.EntityFramework/Stores/OpenIddictAuthorizationStore.cs
  15. 8
      src/OpenIddict.EntityFramework/Stores/OpenIddictScopeStore.cs
  16. 8
      src/OpenIddict.EntityFramework/Stores/OpenIddictTokenStore.cs
  17. 8
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs
  18. 8
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs
  19. 8
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictScopeStore.cs
  20. 8
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictTokenStore.cs

8
src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs

@ -312,14 +312,14 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public virtual Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TApplication>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -486,7 +486,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -501,7 +501,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs

@ -237,14 +237,14 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public virtual Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TAuthorization>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -339,7 +339,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -354,7 +354,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs

@ -156,14 +156,14 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public virtual Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TScope>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -176,7 +176,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -191,7 +191,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs

@ -294,14 +294,14 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public virtual Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TToken>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -513,7 +513,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -528,7 +528,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Stores/IOpenIddictApplicationStore.cs

@ -117,14 +117,14 @@ namespace OpenIddict.Core
Task<ImmutableArray<TApplication>> FindByRedirectUriAsync([NotNull] string address, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TApplication>, IQueryable<TResult>> query, CancellationToken cancellationToken);
@ -208,7 +208,7 @@ namespace OpenIddict.Core
Task<ImmutableArray<string>> GetRedirectUrisAsync([NotNull] TApplication application, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -220,7 +220,7 @@ namespace OpenIddict.Core
Task<ImmutableArray<TApplication>> ListAsync([CanBeNull] int? count, [CanBeNull] int? offset, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Stores/IOpenIddictAuthorizationStore.cs

@ -107,14 +107,14 @@ namespace OpenIddict.Core
Task<string> GetApplicationIdAsync([NotNull] TAuthorization authorization, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TAuthorization>, IQueryable<TResult>> query, CancellationToken cancellationToken);
@ -163,7 +163,7 @@ namespace OpenIddict.Core
Task<string> GetTypeAsync([NotNull] TAuthorization authorization, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -175,7 +175,7 @@ namespace OpenIddict.Core
Task<ImmutableArray<TAuthorization>> ListAsync([CanBeNull] int? count, [CanBeNull] int? offset, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Stores/IOpenIddictScopeStore.cs

@ -72,19 +72,19 @@ namespace OpenIddict.Core
Task DeleteAsync([NotNull] TScope scope, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TScope>, IQueryable<TResult>> query, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -96,7 +96,7 @@ namespace OpenIddict.Core
Task<ImmutableArray<TScope>> ListAsync([CanBeNull] int? count, [CanBeNull] int? offset, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Stores/IOpenIddictTokenStore.cs

@ -136,14 +136,14 @@ namespace OpenIddict.Core
Task<string> GetApplicationIdAsync([NotNull] TToken token, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TToken>, IQueryable<TResult>> query, CancellationToken cancellationToken);
@ -247,7 +247,7 @@ namespace OpenIddict.Core
Task<string> GetTokenTypeAsync([NotNull] TToken token, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -259,7 +259,7 @@ namespace OpenIddict.Core
Task<ImmutableArray<TToken>> ListAsync([CanBeNull] int? count, [CanBeNull] int? offset, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Stores/OpenIddictApplicationStore.cs

@ -261,14 +261,14 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public abstract Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TApplication>, IQueryable<TResult>> query, CancellationToken cancellationToken);
@ -426,7 +426,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -458,7 +458,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Stores/OpenIddictAuthorizationStore.cs

@ -179,14 +179,14 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public abstract Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TAuthorization>, IQueryable<TResult>> query, CancellationToken cancellationToken);
@ -262,7 +262,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -294,7 +294,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Stores/OpenIddictScopeStore.cs

@ -81,19 +81,19 @@ namespace OpenIddict.Core
public abstract Task DeleteAsync([NotNull] TScope scope, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public abstract Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TScope>, IQueryable<TResult>> query, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -125,7 +125,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.Core/Stores/OpenIddictTokenStore.cs

@ -221,14 +221,14 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public abstract Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TToken>, IQueryable<TResult>> query, CancellationToken cancellationToken);
@ -443,7 +443,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <param name="count">The number of results to return.</param>
/// <param name="offset">The number of results to skip.</param>
@ -475,7 +475,7 @@ namespace OpenIddict.Core
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.EntityFramework/Stores/OpenIddictApplicationStore.cs

@ -227,14 +227,14 @@ namespace OpenIddict.EntityFramework
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public override Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TApplication>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -243,11 +243,11 @@ namespace OpenIddict.EntityFramework
throw new ArgumentNullException(nameof(query));
}
return query(Applications).SingleOrDefaultAsync(cancellationToken);
return query(Applications).FirstOrDefaultAsync(cancellationToken);
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.EntityFramework/Stores/OpenIddictAuthorizationStore.cs

@ -240,14 +240,14 @@ namespace OpenIddict.EntityFramework
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public override Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TAuthorization>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -256,11 +256,11 @@ namespace OpenIddict.EntityFramework
throw new ArgumentNullException(nameof(query));
}
return query(Authorizations).SingleOrDefaultAsync(cancellationToken);
return query(Authorizations).FirstOrDefaultAsync(cancellationToken);
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.EntityFramework/Stores/OpenIddictScopeStore.cs

@ -151,14 +151,14 @@ namespace OpenIddict.EntityFramework
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public override Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TScope>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -167,11 +167,11 @@ namespace OpenIddict.EntityFramework
throw new ArgumentNullException(nameof(query));
}
return query(Scopes).SingleOrDefaultAsync(cancellationToken);
return query(Scopes).FirstOrDefaultAsync(cancellationToken);
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.EntityFramework/Stores/OpenIddictTokenStore.cs

@ -224,14 +224,14 @@ namespace OpenIddict.EntityFramework
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public override Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TToken>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -240,7 +240,7 @@ namespace OpenIddict.EntityFramework
throw new ArgumentNullException(nameof(query));
}
return query(Tokens).SingleOrDefaultAsync(cancellationToken);
return query(Tokens).FirstOrDefaultAsync(cancellationToken);
}
/// <summary>
@ -276,7 +276,7 @@ namespace OpenIddict.EntityFramework
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs

@ -208,14 +208,14 @@ namespace OpenIddict.EntityFrameworkCore
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public override Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TApplication>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -224,11 +224,11 @@ namespace OpenIddict.EntityFrameworkCore
throw new ArgumentNullException(nameof(query));
}
return query(Applications).SingleOrDefaultAsync(cancellationToken);
return query(Applications).FirstOrDefaultAsync(cancellationToken);
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs

@ -231,14 +231,14 @@ namespace OpenIddict.EntityFrameworkCore
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public override Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TAuthorization>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -247,11 +247,11 @@ namespace OpenIddict.EntityFrameworkCore
throw new ArgumentNullException(nameof(query));
}
return query(Authorizations).SingleOrDefaultAsync(cancellationToken);
return query(Authorizations).FirstOrDefaultAsync(cancellationToken);
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictScopeStore.cs

@ -151,14 +151,14 @@ namespace OpenIddict.EntityFrameworkCore
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public override Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TScope>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -167,11 +167,11 @@ namespace OpenIddict.EntityFrameworkCore
throw new ArgumentNullException(nameof(query));
}
return query(Scopes).SingleOrDefaultAsync(cancellationToken);
return query(Scopes).FirstOrDefaultAsync(cancellationToken);
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

8
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictTokenStore.cs

@ -241,14 +241,14 @@ namespace OpenIddict.EntityFrameworkCore
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns the first element.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>
/// A <see cref="Task"/> that can be used to monitor the asynchronous operation,
/// whose result returns the single element returned when executing the specified query.
/// whose result returns the first element returned when executing the query.
/// </returns>
public override Task<TResult> GetAsync<TResult>([NotNull] Func<IQueryable<TToken>, IQueryable<TResult>> query, CancellationToken cancellationToken)
{
@ -257,11 +257,11 @@ namespace OpenIddict.EntityFrameworkCore
throw new ArgumentNullException(nameof(query));
}
return query(Tokens).SingleOrDefaultAsync(cancellationToken);
return query(Tokens).FirstOrDefaultAsync(cancellationToken);
}
/// <summary>
/// Executes the specified query.
/// Executes the specified query and returns all the corresponding elements.
/// </summary>
/// <typeparam name="TResult">The result type.</typeparam>
/// <param name="query">The query to execute.</param>

Loading…
Cancel
Save