Class NpgsqlStoreGenerationConvention
- 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
dependenciesProviderConventionSetBuilderDependenciesParameter object containing dependencies for this convention.
relationalDependenciesRelationalConventionSetBuilderDependenciesParameter 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
propertyBuilderIConventionPropertyBuilderThe builder for the property.
namestringThe annotation name.
annotationIConventionAnnotationThe new annotation.
oldAnnotationIConventionAnnotationThe old annotation.
contextIConventionContext<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
propertyIConventionPropertyThe property to check.
storeObjectStoreObjectIdentifierThe identifier of the store object.