Show / Hide Table of Contents

# Class OpenIddictEntityFrameworkCoreHelpers

Exposes extensions simplifying the integration between OpenIddict and Entity Framework Core.

##### Inheritance

System.Object
OpenIddictEntityFrameworkCoreHelpers

##### Inherited Members

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

###### Namespace: Microsoft.EntityFrameworkCore

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

##### Syntax

    public static class OpenIddictEntityFrameworkCoreHelpers

### Methods

#### UseOpenIddict(DbContextOptionsBuilder)

Registers the OpenIddict entity sets in the Entity Framework Core context using the default OpenIddict models and the default key type (string).

##### Declaration

    public static DbContextOptionsBuilder UseOpenIddict(this DbContextOptionsBuilder builder)

##### Parameters

Type | Name | Description
--- | --- | ---
DbContextOptionsBuilder | builder | The builder used to configure the Entity Framework context.

##### Returns

Type | Description
--- | ---
DbContextOptionsBuilder | The Entity Framework context builder.

#### UseOpenIddict(ModelBuilder)

Registers the OpenIddict entity sets in the Entity Framework Core context using the default OpenIddict models and the default key type (string).

##### Declaration

    public static ModelBuilder UseOpenIddict(this ModelBuilder builder)

##### Parameters

Type | Name | Description
--- | --- | ---
ModelBuilder | builder | The builder used to configure the Entity Framework context.

##### Returns

Type | Description
--- | ---
ModelBuilder | The Entity Framework context builder.

#### UseOpenIddict<TKey>(DbContextOptionsBuilder)

Registers the OpenIddict entity sets in the Entity Framework Core context using the default OpenIddict models and the specified key type.

##### Declaration

    public static DbContextOptionsBuilder UseOpenIddict<TKey>(this DbContextOptionsBuilder builder)
        where TKey : IEquatable<TKey>

##### Parameters

Type | Name | Description
--- | --- | ---
DbContextOptionsBuilder | builder | The builder used to configure the Entity Framework context.

##### Returns

Type | Description
--- | ---
DbContextOptionsBuilder | The Entity Framework context builder.

##### Type Parameters

Name | Description
--- | ---
TKey |

##### Remarks

Note: when using a custom key type, the new key type MUST be registered by calling .

#### UseOpenIddict<TKey>(ModelBuilder)

Registers the OpenIddict entity sets in the Entity Framework Core context using the default OpenIddict models and the specified key type.

##### Declaration

    public static ModelBuilder UseOpenIddict<TKey>(this ModelBuilder builder)
        where TKey : IEquatable<TKey>

##### Parameters

Type | Name | Description
--- | --- | ---
ModelBuilder | builder | The builder used to configure the Entity Framework context.

##### Returns

Type | Description
--- | ---
ModelBuilder | The Entity Framework context builder.

##### Type Parameters

Name | Description
--- | ---
TKey |

##### Remarks

Note: when using a custom key type, the new key type MUST be registered by calling .

#### UseOpenIddict<TApplication, TAuthorization, TScope, TToken, TKey>(DbContextOptionsBuilder)

Registers the OpenIddict entity sets in the Entity Framework Core context using the specified entities and the specified key type.

##### Declaration

    public static DbContextOptionsBuilder UseOpenIddict<TApplication, TAuthorization, TScope, TToken, TKey>(this DbContextOptionsBuilder builder)
        where TApplication : OpenIddictEntityFrameworkCoreApplication<TKey, TAuthorization, TToken> where TAuthorization : OpenIddictEntityFrameworkCoreAuthorization<TKey, TApplication, TToken> where TScope : OpenIddictEntityFrameworkCoreScope<TKey> where TToken : OpenIddictEntityFrameworkCoreToken<TKey, TApplication, TAuthorization> where TKey : IEquatable<TKey>

##### Parameters

Type | Name | Description
--- | --- | ---
DbContextOptionsBuilder | builder | The builder used to configure the Entity Framework context.

##### Returns

Type | Description
--- | ---
DbContextOptionsBuilder | The Entity Framework context builder.

##### Type Parameters

Name | Description
--- | ---
TApplication |
TAuthorization |
TScope |
TToken |
TKey |

##### Remarks

Note: when using custom entities, the new entities MUST be registered by calling .

#### UseOpenIddict<TApplication, TAuthorization, TScope, TToken, TKey>(ModelBuilder)

Registers the OpenIddict entity sets in the Entity Framework Core context using the specified entities and the specified key type.

##### Declaration

    public static ModelBuilder UseOpenIddict<TApplication, TAuthorization, TScope, TToken, TKey>(this ModelBuilder builder)
        where TApplication : OpenIddictEntityFrameworkCoreApplication<TKey, TAuthorization, TToken> where TAuthorization : OpenIddictEntityFrameworkCoreAuthorization<TKey, TApplication, TToken> where TScope : OpenIddictEntityFrameworkCoreScope<TKey> where TToken : OpenIddictEntityFrameworkCoreToken<TKey, TApplication, TAuthorization> where TKey : IEquatable<TKey>

##### Parameters

Type | Name | Description
--- | --- | ---
ModelBuilder | builder | The builder used to configure the Entity Framework context.

##### Returns

Type | Description
--- | ---
ModelBuilder | The Entity Framework context builder.

##### Type Parameters

Name | Description
--- | ---
TApplication |
TAuthorization |
TScope |
TToken |
TKey |

##### Remarks

Note: when using custom entities, the new entities MUST be registered by calling .