Class MultitenantIdentityDbContext<TUser, TRole, TAudit, TTenantOidcSetting>
Base class for the Entity Framework database context used for multi-tenant identity.
Inheritance
Microsoft.EntityFrameworkCore.DbContext
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserContext<TUser,
System.Guid,
Microsoft.AspNetCore.Identity.IdentityUserClaim<
System.Guid>,
MultitenantIdentityUserLogin,
Microsoft.AspNetCore.Identity.IdentityUserToken<
System.Guid>>
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole,
System.Guid,
Microsoft.AspNetCore.Identity.IdentityUserClaim<
System.Guid>,
Microsoft.AspNetCore.Identity.IdentityUserRole<
System.Guid>,
MultitenantIdentityUserLogin,
Microsoft.AspNetCore.Identity.IdentityRoleClaim<
System.Guid>,
Microsoft.AspNetCore.Identity.IdentityUserToken<
System.Guid>>
MultitenantIdentityDbContext<TUser, TRole, TAudit, TTenantOidcSetting>
Inherited Members
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserContext<TUser, System.Guid, Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>, IRM.AspNetCore.Identity.MultitenantIdentityUserLogin, Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>>.OnModelCreating(Microsoft.EntityFrameworkCore.ModelBuilder)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserContext<TUser, System.Guid, Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>, IRM.AspNetCore.Identity.MultitenantIdentityUserLogin, Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>>.Users
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserContext<TUser, System.Guid, Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>, IRM.AspNetCore.Identity.MultitenantIdentityUserLogin, Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>>.UserClaims
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserContext<TUser, System.Guid, Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>, IRM.AspNetCore.Identity.MultitenantIdentityUserLogin, Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>>.UserLogins
Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserContext<TUser, System.Guid, Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>, IRM.AspNetCore.Identity.MultitenantIdentityUserLogin, Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>>.UserTokens
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbSetCache.GetOrAddSet(Microsoft.EntityFrameworkCore.Internal.IDbSetSource, System.Type)
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbQueryCache.GetOrAddQuery(Microsoft.EntityFrameworkCore.Internal.IDbQuerySource, System.Type)
Microsoft.EntityFrameworkCore.DbContext.Set<TEntity>()
Microsoft.EntityFrameworkCore.DbContext.Query<TQuery>()
Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder)
Microsoft.EntityFrameworkCore.DbContext.SaveChanges()
Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable.SetPool(Microsoft.EntityFrameworkCore.Internal.IDbContextPool)
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable.Resurrect(Microsoft.EntityFrameworkCore.Internal.DbContextPoolConfigurationSnapshot)
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable.ResetState()
Microsoft.EntityFrameworkCore.DbContext.Dispose()
Microsoft.EntityFrameworkCore.DbContext.Entry<TEntity>(TEntity)
Microsoft.EntityFrameworkCore.DbContext.Add<TEntity>(TEntity)
Microsoft.EntityFrameworkCore.DbContext.AddAsync<TEntity>(TEntity, System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.Attach<TEntity>(TEntity)
Microsoft.EntityFrameworkCore.DbContext.Update<TEntity>(TEntity)
Microsoft.EntityFrameworkCore.DbContext.Remove<TEntity>(TEntity)
Microsoft.EntityFrameworkCore.DbContext.AddAsync(System.Object, System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.Update(System.Object)
Microsoft.EntityFrameworkCore.DbContext.Remove(System.Object)
Microsoft.EntityFrameworkCore.DbContext.AddRangeAsync(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.AttachRange(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.AddRange(System.Collections.Generic.IEnumerable<System.Object>)
Microsoft.EntityFrameworkCore.DbContext.AttachRange(System.Collections.Generic.IEnumerable<System.Object>)
Microsoft.EntityFrameworkCore.DbContext.UpdateRange(System.Collections.Generic.IEnumerable<System.Object>)
Microsoft.EntityFrameworkCore.DbContext.RemoveRange(System.Collections.Generic.IEnumerable<System.Object>)
Microsoft.EntityFrameworkCore.DbContext.FindAsync(System.Type, System.Object[], System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.Find<TEntity>(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.FindAsync<TEntity>(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.FindAsync<TEntity>(System.Object[], System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.Database
Microsoft.EntityFrameworkCore.DbContext.ChangeTracker
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.SetSource
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.QuerySource
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.QueryProvider
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.StateManager
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.ChangeDetector
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.EntityGraphAttacher
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.UpdateLogger
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.InfrastructureLogger
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.Instance
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: IRM.AspNetCore.Identity.EntityFrameworkCore.dll
Syntax
public class MultitenantIdentityDbContext<TUser, TRole, TAudit, TTenantOidcSetting> : IdentityDbContext<TUser, TRole, MultitenantIdentityUserLogin, TAudit>, IDisposable, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbQueryCache, IDbContextPoolable, IDbContextWithSchema where TUser : MultitenantUser where TRole : MultitenantRole where TAudit : IdentityAudit where TTenantOidcSetting : TenantOidcSetting
Type Parameters
TUser
The type of user objects.
|
TRole
The type of role objects.
|
TAudit
The type of the audit object.
|
TTenantOidcSetting
The type of the tenant OpenID Connect setting object.
|
Constructors
Declaration
protected MultitenantIdentityDbContext()
Declaration
public MultitenantIdentityDbContext(DbContextOptions options)
Parameters
Microsoft.EntityFrameworkCore.DbContextOptions
options
The options to be used by a Microsoft.EntityFrameworkCore.DbContext.
|
Properties
Declaration
public DbSet<TenantSettings> TenantAuthenticationSettings { get; set; }
Property Value
Declaration
public DbSet<TenantSaml2Provider> TenantSaml2Provider { get; set; }
Property Value
Methods
Configures the schema needed for TRole
.
Declaration
protected override 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.
|
Overrides
IRM.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, IRM.AspNetCore.Identity.MultitenantIdentityUserLogin, TAudit>.BuildRole(Microsoft.EntityFrameworkCore.ModelBuilder, System.Boolean)
Declaration
protected virtual void BuildTenantAuthenticationSettings(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context.
|
Declaration
protected virtual void BuildTenantSaml2Providers(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context.
|
Configures the schema needed for TUser
.
Declaration
protected override 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.
|
Overrides
IRM.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, IRM.AspNetCore.Identity.MultitenantIdentityUserLogin, TAudit>.BuildUser(Microsoft.EntityFrameworkCore.ModelBuilder, IRM.AspNetCore.Identity.EntityFrameworkCore.PersonalDataConverter, System.Boolean)
Configures the schema needed for TUserLogin
.
Declaration
protected override void BuildUserLogin(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context.
|
Overrides
IRM.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, IRM.AspNetCore.Identity.MultitenantIdentityUserLogin, TAudit>.BuildUserLogin(Microsoft.EntityFrameworkCore.ModelBuilder)
Configures the schema needed for the identity framework.
Declaration
protected override void OnModelCreating(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
The builder being used to construct the model for this context.
|
Overrides
IRM.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<TUser, TRole, IRM.AspNetCore.Identity.MultitenantIdentityUserLogin, TAudit>.OnModelCreating(Microsoft.EntityFrameworkCore.ModelBuilder)