Class OrganisationDbContext<TOrganisation, TPerson>
Base class for the Entity Framework database context used for organisational data.
Inheritance
Inherited Members
Namespace: IRM.AspNetCore.Identity.EntityFrameworkCore
Assembly: IRM.AspNetCore.Identity.EntityFrameworkCore.dll
Syntax
public class OrganisationDbContext<TOrganisation, TPerson> : DbContext, IDisposable, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbQueryCache, IDbContextPoolable, IOrganisationDbContext<TOrganisation, TPerson>, IOrganisationDbContext, IDbContextWithSchema where TOrganisation : class, IOrganisation where TPerson : class, IPerson
Type Parameters
TOrganisation
|
TPerson
|
Constructors
OrganisationDbContext()
Initializes a new instance of the OrganisationDbContext<TOrganisation, TPerson> class.
Declaration
protected OrganisationDbContext()
OrganisationDbContext(DbContextOptions)
Initializes a new instance of the OrganisationDbContext<TOrganisation, TPerson> class.
Declaration
public OrganisationDbContext(DbContextOptions options)
Parameters
Microsoft.EntityFrameworkCore.DbContextOptions
options
The options to be used by a Microsoft.EntityFrameworkCore.DbContext. |
Properties
Organisations
Gets or sets the DbSet<TEntity> of Organisations.
Declaration
public DbSet<TOrganisation> Organisations { get; set; }
Property Value
DbSet<TOrganisation>
|
Implements
Persons
Gets or sets the DbSet<TEntity> of Persons.
Declaration
public DbSet<TPerson> Persons { get; set; }
Property Value
DbSet<TPerson>
|
Implements
Schema
Gets or sets the schema used for the tables. Defaults to "dbo".
Declaration
public string Schema { get; set; }
Property Value
String
|
Implements
Methods
BuildOrganisation(ModelBuilder, Boolean)
Configures the schema needed for TOrganisation
.
Declaration
protected virtual void BuildOrganisation(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. |
BuildPerson(ModelBuilder, PersonalDataConverter, Boolean)
Configures the schema needed for TOrganisation
.
Declaration
protected virtual void BuildPerson(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. |
OnModelCreating(ModelBuilder)
Declaration
protected override void OnModelCreating(ModelBuilder builder)
Parameters
Microsoft.EntityFrameworkCore.ModelBuilder
builder
|