diff --git a/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs b/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs index 54e3e821..c03f9505 100644 --- a/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs +++ b/src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; using CryptoHelper; @@ -38,6 +39,12 @@ namespace OpenIddict.Core /// protected IOpenIddictApplicationStore Store { get; } + /// + /// Gets the applications as a queryable source, + /// if supported by the underlying store. + /// + public virtual IQueryable Applications => Store.Applications; + /// /// Creates a new application. /// diff --git a/src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs b/src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs index 3e6be278..2910e60e 100644 --- a/src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs +++ b/src/OpenIddict.Core/Managers/OpenIddictAuthorizationManager.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; using JetBrains.Annotations; @@ -37,6 +38,12 @@ namespace OpenIddict.Core /// protected IOpenIddictAuthorizationStore Store { get; } + /// + /// Gets the authorizations as a queryable source, + /// if supported by the underlying store. + /// + public virtual IQueryable Authorizations => Store.Authorizations; + /// /// Creates a new authorization. /// diff --git a/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs b/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs index b981ec42..b001add4 100644 --- a/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs +++ b/src/OpenIddict.Core/Managers/OpenIddictScopeManager.cs @@ -4,6 +4,7 @@ * the license and the contributors participating to this project. */ +using System.Linq; using JetBrains.Annotations; using Microsoft.Extensions.Logging; @@ -32,5 +33,11 @@ namespace OpenIddict.Core /// Gets the store associated with the current manager. /// protected IOpenIddictScopeStore Store { get; } + + /// + /// Gets the scopes as a queryable source, + /// if supported by the underlying store. + /// + public virtual IQueryable Scopes => Store.Scopes; } } \ No newline at end of file diff --git a/src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs b/src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs index c1480e63..f1612b2a 100644 --- a/src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs +++ b/src/OpenIddict.Core/Managers/OpenIddictTokenManager.cs @@ -5,6 +5,7 @@ */ using System; +using System.Linq; using System.Threading; using System.Threading.Tasks; using AspNet.Security.OpenIdConnect.Primitives; @@ -37,6 +38,12 @@ namespace OpenIddict.Core /// protected IOpenIddictTokenStore Store { get; } + /// + /// Gets the tokens as a queryable source, + /// if supported by the underlying store. + /// + public virtual IQueryable Tokens => Store.Tokens; + /// /// Creates a new token. /// diff --git a/src/OpenIddict.Core/Stores/IOpenIddictApplicationStore.cs b/src/OpenIddict.Core/Stores/IOpenIddictApplicationStore.cs index 64455d66..1b6338bd 100644 --- a/src/OpenIddict.Core/Stores/IOpenIddictApplicationStore.cs +++ b/src/OpenIddict.Core/Stores/IOpenIddictApplicationStore.cs @@ -5,6 +5,7 @@ */ using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; using JetBrains.Annotations; @@ -17,6 +18,11 @@ namespace OpenIddict.Core /// The type of the Application entity. public interface IOpenIddictApplicationStore where TApplication : class { + /// + /// Gets the applications as a queryable source, if supported by the store. + /// + IQueryable Applications { get; } + /// /// Creates a new application. /// diff --git a/src/OpenIddict.Core/Stores/IOpenIddictAuthorizationStore.cs b/src/OpenIddict.Core/Stores/IOpenIddictAuthorizationStore.cs index dbe35f14..269d6fd5 100644 --- a/src/OpenIddict.Core/Stores/IOpenIddictAuthorizationStore.cs +++ b/src/OpenIddict.Core/Stores/IOpenIddictAuthorizationStore.cs @@ -5,6 +5,7 @@ */ using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; using JetBrains.Annotations; @@ -17,6 +18,11 @@ namespace OpenIddict.Core /// The type of the Authorization entity. public interface IOpenIddictAuthorizationStore where TAuthorization : class { + /// + /// Gets the authorizations as a queryable source, if supported by the store. + /// + IQueryable Authorizations { get; } + /// /// Creates a new authorization. /// diff --git a/src/OpenIddict.Core/Stores/IOpenIddictScopeStore.cs b/src/OpenIddict.Core/Stores/IOpenIddictScopeStore.cs index e72b14d9..6c8eea2b 100644 --- a/src/OpenIddict.Core/Stores/IOpenIddictScopeStore.cs +++ b/src/OpenIddict.Core/Stores/IOpenIddictScopeStore.cs @@ -4,11 +4,19 @@ * the license and the contributors participating to this project. */ +using System.Linq; + namespace OpenIddict.Core { /// /// Provides methods allowing to manage the scopes stored in a database. /// /// The type of the Scope entity. - public interface IOpenIddictScopeStore where TScope : class { } + public interface IOpenIddictScopeStore where TScope : class + { + /// + /// Gets the scopes as a queryable source, if supported by the store. + /// + IQueryable Scopes { get; } + } } \ No newline at end of file diff --git a/src/OpenIddict.Core/Stores/IOpenIddictTokenStore.cs b/src/OpenIddict.Core/Stores/IOpenIddictTokenStore.cs index ca9dc883..5e57edd7 100644 --- a/src/OpenIddict.Core/Stores/IOpenIddictTokenStore.cs +++ b/src/OpenIddict.Core/Stores/IOpenIddictTokenStore.cs @@ -5,6 +5,7 @@ */ using System; +using System.Linq; using System.Threading; using System.Threading.Tasks; using JetBrains.Annotations; @@ -17,6 +18,11 @@ namespace OpenIddict.Core /// The type of the Token entity. public interface IOpenIddictTokenStore where TToken : class { + /// + /// Gets the tokens as a queryable source, if supported by the store. + /// + IQueryable Tokens { get; } + /// /// Creates a new token. /// diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs index 96d5e7ee..fb8ffe3f 100644 --- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs +++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs @@ -78,6 +78,11 @@ namespace OpenIddict.EntityFrameworkCore /// protected DbSet Applications => Context.Set(); + /// + /// Gets the applications as a queryable source, if supported by the store. + /// + IQueryable IOpenIddictApplicationStore.Applications => Applications; + /// /// Creates a new application. /// diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs index 87a99740..d6388e61 100644 --- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs +++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs @@ -83,6 +83,11 @@ namespace OpenIddict.EntityFrameworkCore /// protected DbSet Authorizations => Context.Set(); + /// + /// Gets the authorizations as a queryable source, if supported by the store. + /// + IQueryable IOpenIddictAuthorizationStore.Authorizations => Authorizations; + /// /// Creates a new authorization. /// diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictScopeStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictScopeStore.cs index c67239e4..7595cf72 100644 --- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictScopeStore.cs +++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictScopeStore.cs @@ -6,6 +6,7 @@ using System; using System.ComponentModel; +using System.Linq; using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using OpenIddict.Core; @@ -66,6 +67,11 @@ namespace OpenIddict.EntityFrameworkCore /// protected DbSet Scopes => Context.Set(); + /// + /// Gets the scopes as a queryable source, if supported by the store. + /// + IQueryable IOpenIddictScopeStore.Scopes => Scopes; + /// /// Converts the provided identifier to a strongly typed key object. /// diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictTokenStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictTokenStore.cs index 399a8189..aac99c01 100644 --- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictTokenStore.cs +++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictTokenStore.cs @@ -87,6 +87,11 @@ namespace OpenIddict.EntityFrameworkCore /// protected DbSet Tokens => Context.Set(); + /// + /// Gets the tokens as a queryable source, if supported by the store. + /// + IQueryable IOpenIddictTokenStore.Tokens => Tokens; + /// /// Creates a new token. ///