Browse Source

Add extra constructors to OpenIddictContext

pull/63/head
Kévin Chalet 11 years ago
parent
commit
9ea6a517bd
  1. 38
      src/OpenIddict.EF/OpenIddictContext.cs

38
src/OpenIddict.EF/OpenIddictContext.cs

@ -7,6 +7,7 @@
using System; using System;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using OpenIddict.Models; using OpenIddict.Models;
namespace OpenIddict { namespace OpenIddict {
@ -15,10 +16,43 @@ namespace OpenIddict {
where TApplication : Application where TApplication : Application
where TRole : IdentityRole<TKey> where TRole : IdentityRole<TKey>
where TKey : IEquatable<TKey> { where TKey : IEquatable<TKey> {
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<TApplication> Applications { get; set; } public DbSet<TApplication> Applications { get; set; }
} }
public class OpenIddictContext<TUser> : OpenIddictContext<TUser, Application, IdentityRole, string> where TUser : IdentityUser { } public class OpenIddictContext<TUser> : OpenIddictContext<TUser, Application, IdentityRole, string> 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<IdentityUser> {
public OpenIddictContext() { }
public class OpenIddictContext : OpenIddictContext<IdentityUser> { } public OpenIddictContext(DbContextOptions options)
: base(options) { }
public OpenIddictContext(IServiceProvider services)
: base(services) { }
public OpenIddictContext(IServiceProvider services, DbContextOptions options)
: base(services, options) { }
}
} }
Loading…
Cancel
Save