diff --git a/README.md b/README.md index 0c73bead..b15f4000 100644 --- a/README.md +++ b/README.md @@ -102,17 +102,17 @@ public void Configure(IApplicationBuilder app) { public class ApplicationUser : OpenIddictUser { } ``` - - **Update your Entity Framework context to inherit from `OpenIddictContext`**: + - **Update your Entity Framework context to inherit from `OpenIddictDbContext`**: ```csharp -public class ApplicationDbContext : OpenIddictContext { +public class ApplicationDbContext : OpenIddictDbContext { public ApplicationDbContext(DbContextOptions options) : base(options) { } } ``` -> **Note:** although recommended, inheriting from `OpenIddictContext` is not mandatory. Alternatively, you can also create your own context and manually add the entity sets needed by OpenIddict: +> **Note:** although recommended, inheriting from `OpenIddictDbContext` is not mandatory. Alternatively, you can also create your own context and manually add the entity sets needed by OpenIddict: ```csharp public class ApplicationDbContext : IdentityDbContext { diff --git a/samples/Mvc.Server/Models/ApplicationDbContext.cs b/samples/Mvc.Server/Models/ApplicationDbContext.cs index e8b35b12..6cd1398a 100644 --- a/samples/Mvc.Server/Models/ApplicationDbContext.cs +++ b/samples/Mvc.Server/Models/ApplicationDbContext.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using OpenIddict; namespace Mvc.Server.Models { - public class ApplicationDbContext : OpenIddictContext, Guid> { + public class ApplicationDbContext : OpenIddictDbContext, Guid> { public ApplicationDbContext(DbContextOptions options) : base(options) { } diff --git a/src/OpenIddict.EntityFramework/OpenIddictContext.cs b/src/OpenIddict.EntityFramework/OpenIddictDbContext.cs similarity index 83% rename from src/OpenIddict.EntityFramework/OpenIddictContext.cs rename to src/OpenIddict.EntityFramework/OpenIddictDbContext.cs index d9e1b47e..26f1d7cf 100644 --- a/src/OpenIddict.EntityFramework/OpenIddictContext.cs +++ b/src/OpenIddict.EntityFramework/OpenIddictDbContext.cs @@ -12,38 +12,38 @@ namespace OpenIddict { /// /// Represents an OpenIddict-powered Entity Framework context. /// - public class OpenIddictContext : OpenIddictContext { + public class OpenIddictDbContext : OpenIddictDbContext { /// /// Initializes a new OpenIddict context without configuring the Entity Framework options. /// - protected OpenIddictContext() { } + protected OpenIddictDbContext() { } /// /// Initializes a new OpenIddict context. /// /// The options used to configure the Entity Framework context. - public OpenIddictContext(DbContextOptions options) : base(options) { } + public OpenIddictDbContext(DbContextOptions options) : base(options) { } } /// /// Represents an OpenIddict-powered Entity Framework context. /// /// The type of the User entity. - public class OpenIddictContext : OpenIddictContext + public class OpenIddictDbContext : OpenIddictDbContext where TUser : OpenIddictUser { /// /// Initializes a new OpenIddict context without configuring the Entity Framework options. /// - protected OpenIddictContext() { } + protected OpenIddictDbContext() { } /// /// Initializes a new OpenIddict context. /// /// The options used to configure the Entity Framework context. - public OpenIddictContext(DbContextOptions options) : base(options) { } + public OpenIddictDbContext(DbContextOptions options) : base(options) { } } /// @@ -51,22 +51,22 @@ namespace OpenIddict { /// /// The type of the User entity. /// The type of the Role entity. - public class OpenIddictContext : OpenIddictContext + public class OpenIddictDbContext : OpenIddictDbContext where TUser : OpenIddictUser where TRole : IdentityRole { /// /// Initializes a new OpenIddict context without configuring the Entity Framework options. /// - protected OpenIddictContext() { } + protected OpenIddictDbContext() { } /// /// Initializes a new OpenIddict context. /// /// The options used to configure the Entity Framework context. - public OpenIddictContext(DbContextOptions options) : base(options) { } + public OpenIddictDbContext(DbContextOptions options) : base(options) { } } /// @@ -75,23 +75,23 @@ namespace OpenIddict { /// The type of the User entity. /// The type of the Role entity. /// The type of the primary key used by the Identity/OpenIddict entities. - public class OpenIddictContext : OpenIddictContext, - OpenIddictAuthorization, - OpenIddictScope, - OpenIddictToken, TKey> + public class OpenIddictDbContext : OpenIddictDbContext, + OpenIddictAuthorization, + OpenIddictScope, + OpenIddictToken, TKey> where TUser : OpenIddictUser where TRole : IdentityRole where TKey : IEquatable { /// /// Initializes a new OpenIddict context without configuring the Entity Framework options. /// - protected OpenIddictContext() { } + protected OpenIddictDbContext() { } /// /// Initializes a new OpenIddict context. /// /// The options used to configure the Entity Framework context. - public OpenIddictContext(DbContextOptions options) : base(options) { } + public OpenIddictDbContext(DbContextOptions options) : base(options) { } } /// @@ -104,7 +104,7 @@ namespace OpenIddict { /// The type of the Scope entity. /// The type of the Token entity. /// The type of the primary key used by the Identity/OpenIddict entities. - public class OpenIddictContext : IdentityDbContext + public class OpenIddictDbContext : IdentityDbContext where TUser : OpenIddictUser where TRole : IdentityRole where TApplication : OpenIddictApplication @@ -115,13 +115,13 @@ namespace OpenIddict { /// /// Initializes a new OpenIddict context without configuring the Entity Framework options. /// - protected OpenIddictContext() { } + protected OpenIddictDbContext() { } /// /// Initializes a new OpenIddict context. /// /// The options used to configure the Entity Framework context. - public OpenIddictContext(DbContextOptions options) : base(options) { } + public OpenIddictDbContext(DbContextOptions options) : base(options) { } /// /// Gets or sets the database set containing the applications.