Show / Hide Table of Contents

# Class OpenIddictCoreBuilder

Exposes the necessary methods required to configure the OpenIddict core services.

##### Inheritance

System.Object
OpenIddictCoreBuilder

##### Inherited Members

System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)

###### Namespace: Microsoft.Extensions.DependencyInjection

###### Assembly: cs.temp.dll.dll

##### Syntax

    public class OpenIddictCoreBuilder

### Constructors

#### OpenIddictCoreBuilder(IServiceCollection)

Initializes a new instance of OpenIddictCoreBuilder.

##### Declaration

    public OpenIddictCoreBuilder(IServiceCollection services)

##### Parameters

Type | Name | Description
--- | --- | ---
IServiceCollection | services | The services collection.

### Properties

#### Services

Gets the services collection.

##### Declaration

    public IServiceCollection Services { get; }

##### Property Value

Type | Description
--- | ---
IServiceCollection |

### Methods

#### AddApplicationStore(Type, ServiceLifetime)

Adds a custom application store by a custom implementation derived from . Note: when using this overload, the application store can be either a non-generic, a closed or an open generic service.

##### Declaration

    public OpenIddictCoreBuilder AddApplicationStore(Type type, ServiceLifetime lifetime = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom store.
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### AddApplicationStore<TStore>(ServiceLifetime)

Adds a custom application store by a custom implementation derived from . Note: when using this overload, the application store must be either a non-generic or closed generic service.

##### Declaration

    public OpenIddictCoreBuilder AddApplicationStore<TStore>(ServiceLifetime lifetime = null)
        where TStore : class

##### Parameters

Type | Name | Description
--- | --- | ---
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TStore | The type of the custom store.

#### AddAuthorizationStore(Type, ServiceLifetime)

Adds a custom authorization store by a custom implementation derived from . Note: when using this overload, the authorization store can be either a non-generic, a closed or an open generic service.

##### Declaration

    public OpenIddictCoreBuilder AddAuthorizationStore(Type type, ServiceLifetime lifetime = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom store.
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### AddAuthorizationStore<TStore>(ServiceLifetime)

Adds a custom authorization store by a custom implementation derived from . Note: when using this overload, the authorization store must be either a non-generic or closed generic service.

##### Declaration

    public OpenIddictCoreBuilder AddAuthorizationStore<TStore>(ServiceLifetime lifetime = null)
        where TStore : class

##### Parameters

Type | Name | Description
--- | --- | ---
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TStore | The type of the custom store.

#### AddScopeStore(Type, ServiceLifetime)

Adds a custom scope store by a custom implementation derived from . Note: when using this overload, the scope store can be either a non-generic, a closed or an open generic service.

##### Declaration

    public OpenIddictCoreBuilder AddScopeStore(Type type, ServiceLifetime lifetime = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom store.
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### AddScopeStore<TStore>(ServiceLifetime)

Adds a custom scope store by a custom implementation derived from . Note: when using this overload, the scope store must be either a non-generic or closed generic service.

##### Declaration

    public OpenIddictCoreBuilder AddScopeStore<TStore>(ServiceLifetime lifetime = null)
        where TStore : class

##### Parameters

Type | Name | Description
--- | --- | ---
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TStore | The type of the custom store.

#### AddTokenStore(Type, ServiceLifetime)

Adds a custom token store by a custom implementation derived from . Note: when using this overload, the token store can be either a non-generic, a closed or an open generic service.

##### Declaration

    public OpenIddictCoreBuilder AddTokenStore(Type type, ServiceLifetime lifetime = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom store.
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### AddTokenStore<TStore>(ServiceLifetime)

Adds a custom token store by a custom implementation derived from . Note: when using this overload, the token store must be either a non-generic or closed generic service.

##### Declaration

    public OpenIddictCoreBuilder AddTokenStore<TStore>(ServiceLifetime lifetime = null)
        where TStore : class

##### Parameters

Type | Name | Description
--- | --- | ---
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TStore | The type of the custom store.

#### Configure(Action<OpenIddictCoreOptions>)

Amends the default OpenIddict core configuration.

##### Declaration

    public OpenIddictCoreBuilder Configure(Action<OpenIddictCoreOptions> configuration)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action<OpenIddictCoreOptions> | configuration | The delegate used to configure the OpenIddict options.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Remarks

This extension can be safely called multiple times.

#### DisableAdditionalFiltering()

Disables additional filtering so that the OpenIddict managers don't execute a second check to ensure the results returned by the stores exactly match the specified query filters, casing included. Additional filtering shouldn't be disabled except when the underlying stores are guaranteed to execute case-sensitive filtering at the database level. Disabling this feature MAY result in security vulnerabilities in the other cases.

##### Declaration

    public OpenIddictCoreBuilder DisableAdditionalFiltering()

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### DisableEntityCaching()

Disables the scoped entity caching applied by the OpenIddict managers. Disabling entity caching may have a noticeable impact on the performance of your application and result in multiple queries being sent by the stores.

##### Declaration

    public OpenIddictCoreBuilder DisableEntityCaching()

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### Equals(Object)

##### Declaration

    public override bool Equals(object obj)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Object | obj |

##### Returns

Type | Description
--- | ---
System.Boolean |

##### Overrides

System.Object.Equals(System.Object)

#### GetHashCode()

##### Declaration

    public override int GetHashCode()

##### Returns

Type | Description
--- | ---
System.Int32 |

##### Overrides

System.Object.GetHashCode()

#### ReplaceApplicationManager(Type)

Replace the default application manager by a custom manager derived from . Note: when using this overload, the application manager can be either a non-generic, a closed or an open generic service.

##### Declaration

    public OpenIddictCoreBuilder ReplaceApplicationManager(Type type)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom manager.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### ReplaceApplicationManager<TManager>()

Replace the default application manager by a custom manager derived from . Note: when using this overload, the application manager must be either a non-generic or closed generic service.

##### Declaration

    public OpenIddictCoreBuilder ReplaceApplicationManager<TManager>()
        where TManager : class

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TManager | The type of the custom manager.

#### ReplaceApplicationStoreResolver(Type, ServiceLifetime)

Replaces the default application store resolver by a custom implementation.

##### Declaration

    public OpenIddictCoreBuilder ReplaceApplicationStoreResolver(Type type, ServiceLifetime lifetime = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom store.
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### ReplaceApplicationStoreResolver<TResolver>(ServiceLifetime)

Replaces the default application store resolver by a custom implementation.

##### Declaration

    public OpenIddictCoreBuilder ReplaceApplicationStoreResolver<TResolver>(ServiceLifetime lifetime = null)
        where TResolver : IOpenIddictApplicationStoreResolver

##### Parameters

Type | Name | Description
--- | --- | ---
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TResolver | The type of the custom store.

#### ReplaceAuthorizationManager(Type)

Replace the default authorization manager by a custom manager derived from . Note: when using this overload, the authorization manager can be either a non-generic, a closed or an open generic service.

##### Declaration

    public OpenIddictCoreBuilder ReplaceAuthorizationManager(Type type)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom manager.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### ReplaceAuthorizationManager<TManager>()

Replace the default authorization manager by a custom manager derived from . Note: when using this overload, the authorization manager must be either a non-generic or closed generic service.

##### Declaration

    public OpenIddictCoreBuilder ReplaceAuthorizationManager<TManager>()
        where TManager : class

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TManager | The type of the custom manager.

#### ReplaceAuthorizationStoreResolver(Type, ServiceLifetime)

Replaces the default authorization store resolver by a custom implementation.

##### Declaration

    public OpenIddictCoreBuilder ReplaceAuthorizationStoreResolver(Type type, ServiceLifetime lifetime = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom store.
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### ReplaceAuthorizationStoreResolver<TResolver>(ServiceLifetime)

Replaces the default authorization store resolver by a custom implementation.

##### Declaration

    public OpenIddictCoreBuilder ReplaceAuthorizationStoreResolver<TResolver>(ServiceLifetime lifetime = null)
        where TResolver : IOpenIddictAuthorizationStoreResolver

##### Parameters

Type | Name | Description
--- | --- | ---
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TResolver | The type of the custom store.

#### ReplaceScopeManager(Type)

Replace the default scope manager by a custom manager derived from . Note: when using this overload, the scope manager can be either a non-generic, a closed or an open generic service.

##### Declaration

    public OpenIddictCoreBuilder ReplaceScopeManager(Type type)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom manager.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### ReplaceScopeManager<TManager>()

Replace the default scope manager by a custom manager derived from . Note: when using this overload, the scope manager must be either a non-generic or closed generic service.

##### Declaration

    public OpenIddictCoreBuilder ReplaceScopeManager<TManager>()
        where TManager : class

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TManager | The type of the custom manager.

#### ReplaceScopeStoreResolver(Type, ServiceLifetime)

Replaces the default scope store resolver by a custom implementation.

##### Declaration

    public OpenIddictCoreBuilder ReplaceScopeStoreResolver(Type type, ServiceLifetime lifetime = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom store.
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### ReplaceScopeStoreResolver<TResolver>(ServiceLifetime)

Replaces the default scope store resolver by a custom implementation.

##### Declaration

    public OpenIddictCoreBuilder ReplaceScopeStoreResolver<TResolver>(ServiceLifetime lifetime = null)
        where TResolver : IOpenIddictScopeStoreResolver

##### Parameters

Type | Name | Description
--- | --- | ---
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TResolver | The type of the custom store.

#### ReplaceTokenManager(Type)

Replace the default token manager by a custom manager derived from . Note: when using this overload, the token manager can be either a non-generic, a closed or an open generic service.

##### Declaration

    public OpenIddictCoreBuilder ReplaceTokenManager(Type type)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom manager.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### ReplaceTokenManager<TManager>()

Replace the default token manager by a custom manager derived from . Note: when using this overload, the token manager must be either a non-generic or closed generic service.

##### Declaration

    public OpenIddictCoreBuilder ReplaceTokenManager<TManager>()
        where TManager : class

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TManager | The type of the custom manager.

#### ReplaceTokenStoreResolver(Type, ServiceLifetime)

Replaces the default token store resolver by a custom implementation.

##### Declaration

    public OpenIddictCoreBuilder ReplaceTokenStoreResolver(Type type, ServiceLifetime lifetime = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The type of the custom store.
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### ReplaceTokenStoreResolver<TResolver>(ServiceLifetime)

Replaces the default token store resolver by a custom implementation.

##### Declaration

    public OpenIddictCoreBuilder ReplaceTokenStoreResolver<TResolver>(ServiceLifetime lifetime = null)
        where TResolver : IOpenIddictTokenStoreResolver

##### Parameters

Type | Name | Description
--- | --- | ---
ServiceLifetime | lifetime | The lifetime of the registered service.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TResolver | The type of the custom store.

#### SetDefaultApplicationEntity(Type)

Configures OpenIddict to use the specified entity as the default application entity.

##### Declaration

    public OpenIddictCoreBuilder SetDefaultApplicationEntity(Type type)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The application entity type.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### SetDefaultApplicationEntity<TApplication>()

Configures OpenIddict to use the specified entity as the default application entity.

##### Declaration

    public OpenIddictCoreBuilder SetDefaultApplicationEntity<TApplication>()
        where TApplication : class

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TApplication |

#### SetDefaultAuthorizationEntity(Type)

Configures OpenIddict to use the specified entity as the default authorization entity.

##### Declaration

    public OpenIddictCoreBuilder SetDefaultAuthorizationEntity(Type type)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The authorization entity type.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### SetDefaultAuthorizationEntity<TAuthorization>()

Configures OpenIddict to use the specified entity as the default authorization entity.

##### Declaration

    public OpenIddictCoreBuilder SetDefaultAuthorizationEntity<TAuthorization>()
        where TAuthorization : class

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TAuthorization |

#### SetDefaultScopeEntity(Type)

Configures OpenIddict to use the specified entity as the default scope entity.

##### Declaration

    public OpenIddictCoreBuilder SetDefaultScopeEntity(Type type)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The scope entity type.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### SetDefaultScopeEntity<TScope>()

Configures OpenIddict to use the specified entity as the default scope entity.

##### Declaration

    public OpenIddictCoreBuilder SetDefaultScopeEntity<TScope>()
        where TScope : class

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TScope |

#### SetDefaultTokenEntity(Type)

Configures OpenIddict to use the specified entity as the default token entity.

##### Declaration

    public OpenIddictCoreBuilder SetDefaultTokenEntity(Type type)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type | The token entity type.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### SetDefaultTokenEntity<TToken>()

Configures OpenIddict to use the specified entity as the default token entity.

##### Declaration

    public OpenIddictCoreBuilder SetDefaultTokenEntity<TToken>()
        where TToken : class

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

##### Type Parameters

Name | Description
--- | ---
TToken |

#### SetEntityCacheLimit(Int32)

Configures OpenIddict to use the specified entity cache limit, after which the internal cache is automatically compacted.

##### Declaration

    public OpenIddictCoreBuilder SetEntityCacheLimit(int limit)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | limit | The cache limit, in number of entries.

##### Returns

Type | Description
--- | ---
OpenIddictCoreBuilder | The OpenIddictCoreBuilder.

#### ToString()

##### Declaration

    public override string ToString()

##### Returns

Type | Description
--- | ---
System.String |

##### Overrides

System.Object.ToString()