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
dependencies
ProviderConventionSetBuilderDependenciesParameter object containing dependencies for this convention.
relationalDependencies
RelationalConventionSetBuilderDependenciesParameter 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
IConventionPropertyBuilderThe builder for the property.
name
stringThe annotation name.
annotation
IConventionAnnotationThe new annotation.
oldAnnotation
IConventionAnnotationThe 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
IConventionPropertyThe property to check.
storeObject
StoreObjectIdentifierThe identifier of the store object.