Class NpgsqlValueGenerationConvention
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.dll
A convention that configures store value generation as OnAdd on properties that are part of the primary key and not part of any foreign keys, were configured to have a database default value or were configured to use a NpgsqlValueGenerationStrategy. It also configures properties as OnAddOrUpdate if they were configured as computed columns.
public class NpgsqlValueGenerationConvention : RelationalValueGenerationConvention, IEntityTypePrimaryKeyChangedConvention, IForeignKeyAddedConvention, IForeignKeyRemovedConvention, IForeignKeyPropertiesChangedConvention, IEntityTypeBaseTypeChangedConvention, IForeignKeyOwnershipChangedConvention, IPropertyAnnotationChangedConvention, IEntityTypeAnnotationChangedConvention, IConvention- Inheritance
- 
      
      
      
      NpgsqlValueGenerationConvention
- Implements
- Inherited Members
Constructors
NpgsqlValueGenerationConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies)
Creates a new instance of NpgsqlValueGenerationConvention.
public NpgsqlValueGenerationConvention(ProviderConventionSetBuilderDependencies dependencies, RelationalConventionSetBuilderDependencies relationalDependencies)Parameters
- dependenciesProviderConventionSetBuilderDependencies
- Parameter object containing dependencies for this convention. 
- relationalDependenciesRelationalConventionSetBuilderDependencies
- Parameter object containing relational dependencies for this convention. 
Methods
GetValueGenerated(IConventionProperty)
Returns the store value generation strategy to set for the given property.
protected override ValueGenerated? GetValueGenerated(IConventionProperty property)Parameters
- propertyIConventionProperty
- The property. 
Returns
- ValueGenerated?
- The store value generation strategy to set for the given property. 
GetValueGenerated(IReadOnlyProperty, in StoreObjectIdentifier)
Returns the store value generation strategy to set for the given property.
public static ValueGenerated? GetValueGenerated(IReadOnlyProperty property, in StoreObjectIdentifier storeObject)Parameters
- propertyIReadOnlyProperty
- The property. 
- storeObjectStoreObjectIdentifier
- The identifier of the store object. 
Returns
- ValueGenerated?
- The store value generation strategy to set for the given property. 
ProcessPropertyAnnotationChanged(IConventionPropertyBuilder, string, IConventionAnnotation?, IConventionAnnotation?, IConventionContext<IConventionAnnotation>)
Called after an annotation is changed on a property.
public override void ProcessPropertyAnnotationChanged(IConventionPropertyBuilder propertyBuilder, string name, IConventionAnnotation? annotation, IConventionAnnotation? oldAnnotation, IConventionContext<IConventionAnnotation> context)Parameters
- propertyBuilderIConventionPropertyBuilder
- The builder for the property. 
- namestring
- The annotation name. 
- annotationIConventionAnnotation
- The new annotation. 
- oldAnnotationIConventionAnnotation
- The old annotation. 
- contextIConventionContext<IConventionAnnotation>
- Additional information associated with convention execution.