Table of Contents

Class NpgsqlStoreGenerationConvention

Namespace
Npgsql.EntityFrameworkCore.PostgreSQL.Metadata.Conventions
Assembly
Npgsql.EntityFrameworkCore.PostgreSQL.dll

A convention that ensures that properties aren't configured to have a default value, as computed column or using a NpgsqlValueGenerationStrategy at the same time.

public class NpgsqlStoreGenerationConvention : StoreGenerationConvention, IPropertyAnnotationChangedConvention, IModelFinalizingConvention, IConvention
Inheritance
NpgsqlStoreGenerationConvention
Implements
Inherited Members

Constructors

NpgsqlStoreGenerationConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies)

Creates a new instance of NpgsqlStoreGenerationConvention.

public NpgsqlStoreGenerationConvention(ProviderConventionSetBuilderDependencies dependencies, RelationalConventionSetBuilderDependencies relationalDependencies)

Parameters

dependencies ProviderConventionSetBuilderDependencies

Parameter object containing dependencies for this convention.

relationalDependencies RelationalConventionSetBuilderDependencies

Parameter object containing relational dependencies for this convention.

Methods

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

propertyBuilder IConventionPropertyBuilder

The builder for the property.

name string

The annotation name.

annotation IConventionAnnotation

The new annotation.

oldAnnotation IConventionAnnotation

The old annotation.

context IConventionContext<IConventionAnnotation>

Additional information associated with convention execution.

Validate(IConventionProperty, in StoreObjectIdentifier)

Throws if there is conflicting store generation configuration for this property.

protected override void Validate(IConventionProperty property, in StoreObjectIdentifier storeObject)

Parameters

property IConventionProperty

The property to check.

storeObject StoreObjectIdentifier

The identifier of the store object.