From 9ea6a517bd6c0adff3db3988a89abeff5c14db7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Sat, 20 Feb 2016 17:49:48 +0100 Subject: [PATCH] Add extra constructors to OpenIddictContext --- src/OpenIddict.EF/OpenIddictContext.cs | 38 ++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/OpenIddict.EF/OpenIddictContext.cs b/src/OpenIddict.EF/OpenIddictContext.cs index 45012696..f7a1b837 100644 --- a/src/OpenIddict.EF/OpenIddictContext.cs +++ b/src/OpenIddict.EF/OpenIddictContext.cs @@ -7,6 +7,7 @@ using System; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; using OpenIddict.Models; namespace OpenIddict { @@ -15,10 +16,43 @@ namespace OpenIddict { where TApplication : Application where TRole : IdentityRole where TKey : IEquatable { + public 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 class OpenIddictContext : OpenIddictContext where TUser : IdentityUser { + public 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() { } - public class OpenIddictContext : 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