IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken> Class¶
Base class for the Entity Framework database context used for identity.
- Namespace
Microsoft.AspNetCore.Identity.EntityFrameworkCore
- Assemblies
- Microsoft.AspNetCore.Identity.EntityFrameworkCore
Inheritance Hierarchy¶
System.Object
Microsoft.EntityFrameworkCore.DbContext
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken>
Syntax¶
public abstract class IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken> : DbContext, IDisposable, IInfrastructure<IServiceProvider> where TUser : IdentityUser<TKey, TUserClaim, TUserRole, TUserLogin> where TRole : IdentityRole<TKey, TUserRole, TRoleClaim> where TKey : IEquatable<TKey> where TUserClaim : IdentityUserClaim<TKey> where TUserRole : IdentityUserRole<TKey> where TUserLogin : IdentityUserLogin<TKey> where TRoleClaim : IdentityRoleClaim<TKey> where TUserToken : IdentityUserToken<TKey>
-
class
Microsoft.AspNetCore.Identity.EntityFrameworkCore.
IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken>
¶
Constructors¶
-
IdentityDbContext
()¶ Initializes a new instance of the
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext
class.protected IdentityDbContext()
-
IdentityDbContext
(Microsoft.EntityFrameworkCore.DbContextOptions) Initializes a new instance of
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext
.Arguments: options (Microsoft.EntityFrameworkCore.DbContextOptions) – The options to be used by a Microsoft.EntityFrameworkCore.DbContext
.public IdentityDbContext(DbContextOptions options)
-
Methods¶
-
OnModelCreating
(Microsoft.EntityFrameworkCore.ModelBuilder)¶ Configures the schema needed for the identity framework.
Arguments: builder (Microsoft.EntityFrameworkCore.ModelBuilder) – The builder being used to construct the model for this context. protected override void OnModelCreating(ModelBuilder builder)
-
Properties¶
-
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken>.
RoleClaims
¶ Gets or sets the
Microsoft.EntityFrameworkCore.DbSet`1
of role claims.Return type: Microsoft.EntityFrameworkCore.DbSet<TRoleClaim> public DbSet<TRoleClaim> RoleClaims { get; set; }
-
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken>.
Roles
¶ Gets or sets the
Microsoft.EntityFrameworkCore.DbSet`1
of roles.Return type: Microsoft.EntityFrameworkCore.DbSet<TRole> public DbSet<TRole> Roles { get; set; }
-
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken>.
UserClaims
¶ Gets or sets the
Microsoft.EntityFrameworkCore.DbSet`1
of User claims.Return type: Microsoft.EntityFrameworkCore.DbSet<TUserClaim> public DbSet<TUserClaim> UserClaims { get; set; }
-
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken>.
UserLogins
¶ Gets or sets the
Microsoft.EntityFrameworkCore.DbSet`1
of User logins.Return type: Microsoft.EntityFrameworkCore.DbSet<TUserLogin> public DbSet<TUserLogin> UserLogins { get; set; }
-
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken>.
UserRoles
¶ Gets or sets the
Microsoft.EntityFrameworkCore.DbSet`1
of User roles.Return type: Microsoft.EntityFrameworkCore.DbSet<TUserRole> public DbSet<TUserRole> UserRoles { get; set; }
-
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken>.
UserTokens
¶ Gets or sets the
Microsoft.EntityFrameworkCore.DbSet`1
of User tokens.Return type: Microsoft.EntityFrameworkCore.DbSet<TUserToken> public DbSet<TUserToken> UserTokens { get; set; }
-
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken>.
Users
¶ Gets or sets the
Microsoft.EntityFrameworkCore.DbSet`1
of Users.Return type: Microsoft.EntityFrameworkCore.DbSet<TUser> public DbSet<TUser> Users { get; set; }
-