diff --git a/samples/Mvc.Server/Models/ApplicationDbContext.cs b/samples/Mvc.Server/Models/ApplicationDbContext.cs index b4733b60..4127fc7c 100644 --- a/samples/Mvc.Server/Models/ApplicationDbContext.cs +++ b/samples/Mvc.Server/Models/ApplicationDbContext.cs @@ -3,6 +3,9 @@ using OpenIddict; namespace Mvc.Server.Models { public class ApplicationDbContext : OpenIddictContext { + public ApplicationDbContext(DbContextOptions options) + : base(options) { } + protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); diff --git a/samples/Mvc.Server/Startup.cs b/samples/Mvc.Server/Startup.cs index 3e2e900d..4997daf6 100644 --- a/samples/Mvc.Server/Startup.cs +++ b/samples/Mvc.Server/Startup.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -39,7 +40,7 @@ namespace Mvc.Server { services.AddMvcDnx(); services.AddEntityFramework() - .AddSqlServer() + .AddEntityFrameworkSqlServer() .AddDbContext(options => options.UseSqlServer(configuration["Data:DefaultConnection:ConnectionString"])); diff --git a/src/OpenIddict.EF/OpenIddictContext.cs b/src/OpenIddict.EF/OpenIddictContext.cs index a7fee4ab..b80885c0 100644 --- a/src/OpenIddict.EF/OpenIddictContext.cs +++ b/src/OpenIddict.EF/OpenIddictContext.cs @@ -7,7 +7,6 @@ using System; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; using OpenIddict.Models; namespace OpenIddict { @@ -16,43 +15,25 @@ namespace OpenIddict { where TApplication : Application where TRole : IdentityRole where TKey : IEquatable { - public OpenIddictContext() { } + protected OpenIddictContext() { } public OpenIddictContext(DbContextOptions options) : base(options) { } - public OpenIddictContext(IServiceProvider services) - : base(services) { } - - public OpenIddictContext(IServiceProvider services, DbContextOptions options) - : base(services, options) { } - public DbSet Applications { get; set; } } public class OpenIddictContext : OpenIddictContext where TUser : IdentityUser { - public OpenIddictContext() { } + protected OpenIddictContext() { } public OpenIddictContext(DbContextOptions options) : base(options) { } - - public OpenIddictContext(IServiceProvider services) - : base(services) { } - - public OpenIddictContext(IServiceProvider services, DbContextOptions options) - : base(services, options) { } } public class OpenIddictContext : OpenIddictContext { - public OpenIddictContext() { } + protected OpenIddictContext() { } public OpenIddictContext(DbContextOptions options) : base(options) { } - - public OpenIddictContext(IServiceProvider services) - : base(services) { } - - public OpenIddictContext(IServiceProvider services, DbContextOptions options) - : base(services, options) { } } } \ No newline at end of file