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
typeMappingSource
IRelationalTypeMappingSourceThe type mapping source to use.
enumDefinitions
IReadOnlyList<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
property
IConventionPropertytypeMapping
RelationalTypeMappingmodelBuilder
IConventionModelBuilder
ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)
Called when a model is being finalized.
public virtual void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConventionContext<IConventionModelBuilder> context)
Parameters
modelBuilder
IConventionModelBuilderThe builder for the model.
context
IConventionContext<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
property
IConventionPropertytypeMapping
RelationalTypeMapping
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
modelBuilder
IConventionModelBuilder