Class IdentityDbContext<TUser, TRole, TUserLogin, TAudit>
Base class for the Entity Framework database context used for identity.
Inheritance
Inherited Members
Namespace: IRM.AspNetCore.Identity.EntityFrameworkCore
Assembly: IRM.AspNetCore.Identity.EntityFrameworkCore.dll
Syntax
public class IdentityDbContext<TUser, TRole, TUserLogin, TAudit> : IdentityDbContext<TUser, TRole, Guid, IdentityUserClaim<Guid>, IdentityUserRole<Guid>, TUserLogin, IdentityRoleClaim<Guid>, IdentityUserToken<Guid>>, IDisposable, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbQueryCache, IDbContextPoolable, IDbContextWithSchema where TUser : IdentityUser where TRole : IdentityRole where TUserLogin : IdentityUserLogin<Guid> where TAudit : IdentityAudit
Type Parameters
TUser
The type of user objects. |
TRole
The type of role objects. |
TUserLogin
The type of the user login object. |
TAudit
The type of the audit object. |
Constructors
IdentityDbContext()
Initializes a new instance of the IdentityDbContext<TUser, TRole, TUserLogin, TAudit> class.
Declaration
protected IdentityDbContext()
IdentityDbContext(DbContextOptions)
Initializes a new instance of IdentityDbContext<TUser, TRole, TUserLogin, TAudit>.
Declaration
public IdentityDbContext(DbContextOptions options)
Parameters
Microsoft.EntityFrameworkCore.DbContextOptions
options
The options to be used by a Microsoft.EntityFrameworkCore.DbContext. |
Properties
Audits
Gets or sets the DbSet<TEntity> of Audits.
Declaration
public DbSet<TAudit> Audits { get; set; }
Property Value
DbSet<TAudit>
|
Schema
Gets or sets the schema used for the tables. Defaults to "security".
Declaration
public string Schema { get; set; }
Property Value
String
|
Implements
Methods
BuildAudit(ModelBuilder)
Configures the schema needed for IdentityAudit.
Declaration
protected virtual void BuildAudit(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context. |
BuildRole(ModelBuilder, Boolean)
Configures the schema needed for TRole
.
Declaration
protected virtual void BuildRole(ModelBuilder builder, bool createDefaultIndexes = true)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context. |
Boolean
createDefaultIndexes
Flag to control if indexes should be created or not. |
BuildRoleClaim(ModelBuilder)
Configures the schema needed for Microsoft.AspNetCore.Identity.IdentityRoleClaim`1.
Declaration
protected virtual void BuildRoleClaim(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context. |
BuildUser(ModelBuilder, PersonalDataConverter, Boolean)
Configures the schema needed for TUser
.
Declaration
protected virtual void BuildUser(ModelBuilder builder, PersonalDataConverter personalDataConverter, bool createDefaultIndexes = true)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context. |
PersonalDataConverter
personalDataConverter
The converter to use to protect properties marked with Microsoft.AspNetCore.Identity.ProtectedPersonalDataAttribute. |
Boolean
createDefaultIndexes
Flag to control if indexes should be created or not. |
BuildUserClaim(ModelBuilder)
Configures the schema needed for Microsoft.AspNetCore.Identity.IdentityUserClaim<TKey>.
Declaration
protected virtual void BuildUserClaim(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context. |
BuildUserLogin(ModelBuilder)
Configures the schema needed for TUserLogin
.
Declaration
protected virtual void BuildUserLogin(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context. |
BuildUserRole(ModelBuilder)
Configures the schema needed for Microsoft.AspNetCore.Identity.IdentityUserRole<TKey>.
Declaration
protected virtual void BuildUserRole(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context. |
BuildUserToken(ModelBuilder)
Configures the schema needed for Microsoft.AspNetCore.Identity.IdentityUserToken<TKey>.
Declaration
protected virtual void BuildUserToken(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context. |
OnModelCreating(ModelBuilder)
Declaration
protected override void OnModelCreating(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
|