Class NpgsqlPostgresModelFinalizingConvention
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.dll
A convention that discovers certain common PostgreSQL extensions based on store types used in the model (e.g. hstore).
public class NpgsqlPostgresModelFinalizingConvention : IModelFinalizingConvention, IConvention
- Inheritance
-
NpgsqlPostgresModelFinalizingConvention
- Implements
- Inherited Members
Remarks
Constructors
NpgsqlPostgresModelFinalizingConvention(IRelationalTypeMappingSource, IReadOnlyList<EnumDefinition>)
Creates a new instance of NpgsqlPostgresModelFinalizingConvention.
public NpgsqlPostgresModelFinalizingConvention(IRelationalTypeMappingSource typeMappingSource, IReadOnlyList<EnumDefinition> enumDefinitions)
Parameters
typeMappingSourceIRelationalTypeMappingSourceThe type mapping source to use.
enumDefinitionsIReadOnlyList<EnumDefinition>
Methods
DiscoverPostgresExtensions(IConventionProperty, RelationalTypeMapping, IConventionModelBuilder)
Discovers certain common PostgreSQL extensions based on property store types (e.g. hstore).
protected virtual void DiscoverPostgresExtensions(IConventionProperty property, RelationalTypeMapping typeMapping, IConventionModelBuilder modelBuilder)
Parameters
propertyIConventionPropertytypeMappingRelationalTypeMappingmodelBuilderIConventionModelBuilder
ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)
Called when a model is being finalized.
public virtual void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConventionContext<IConventionModelBuilder> context)
Parameters
modelBuilderIConventionModelBuilderThe builder for the model.
contextIConventionContext<IConventionModelBuilder>Additional information associated with convention execution.
ProcessRowVersionProperty(IConventionProperty, RelationalTypeMapping)
Detects properties which are uint, OnAddOrUpdate and configured as concurrency tokens, and maps these to the PostgreSQL internal "xmin" column, which changes every time the row is modified.
protected virtual void ProcessRowVersionProperty(IConventionProperty property, RelationalTypeMapping typeMapping)
Parameters
propertyIConventionPropertytypeMappingRelationalTypeMapping
SetupEnums(IConventionModelBuilder)
Configures the model to create PostgreSQL enums based on the user's enum definitions in the context options.
protected virtual void SetupEnums(IConventionModelBuilder modelBuilder)
Parameters
modelBuilderIConventionModelBuilder