RelationalValueGenerationConvention Class

Definition

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 or were configured to have a database default value. It also configures properties as OnAddOrUpdate if they were configured as computed columns.

public class RelationalValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAnnotationChangedConvention
public class RelationalValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAnnotationChangedConvention
type RelationalValueGenerationConvention = class
    inherit ValueGenerationConvention
    interface IPropertyAnnotationChangedConvention
    interface IConvention
type RelationalValueGenerationConvention = class
    inherit ValueGenerationConvention
    interface IPropertyAnnotationChangedConvention
    interface IConvention
    interface IEntityTypeAnnotationChangedConvention
Public Class RelationalValueGenerationConvention
Inherits ValueGenerationConvention
Implements IPropertyAnnotationChangedConvention
Public Class RelationalValueGenerationConvention
Inherits ValueGenerationConvention
Implements IEntityTypeAnnotationChangedConvention, IPropertyAnnotationChangedConvention
Inheritance
RelationalValueGenerationConvention
Derived
Implements

Remarks

See Model building conventions and EF Core value generation for more information and examples.

Constructors

RelationalValueGenerationConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies)

Creates a new instance of RelationalValueGenerationConvention.

Properties

Dependencies

Dependencies for this service.

(Inherited from ValueGenerationConvention)
RelationalDependencies

Relational provider-specific dependencies for this service.

Methods

GetValueGenerated(IConventionProperty)

Returns the store value generation strategy to set for the given property.

GetValueGenerated(IProperty)

Returns the store value generation strategy to set for the given property.

GetValueGenerated(IProperty, StoreObjectIdentifier)

Returns the store value generation strategy to set for the given property.

GetValueGenerated(IReadOnlyProperty, StoreObjectIdentifier)

Returns the store value generation strategy to set for the given property.

MappingStrategyAllowsValueGeneration(IConventionProperty, String)

Checks whether or not the mapping strategy and property allow value generation by convention.

ProcessEntityTypeAnnotationChanged(IConventionEntityTypeBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

Called after an annotation is changed on an entity type.

ProcessEntityTypeBaseTypeChanged(IConventionEntityTypeBuilder, IConventionEntityType, IConventionEntityType, IConventionContext<IConventionEntityType>)

Called after the base type of an entity type changes.

(Inherited from ValueGenerationConvention)
ProcessEntityTypePrimaryKeyChanged(IConventionEntityTypeBuilder, IConventionKey, IConventionKey, IConventionContext<IConventionKey>)

Called after the primary key for an entity type is changed.

(Inherited from ValueGenerationConvention)
ProcessForeignKeyAdded(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

Called after a foreign key is added to the entity type.

(Inherited from ValueGenerationConvention)
ProcessForeignKeyAdded(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

Called after a foreign key is added to the entity type.

(Inherited from ValueGenerationConvention)
ProcessForeignKeyOwnershipChanged(IConventionForeignKeyBuilder, IConventionContext<Nullable<Boolean>>)

Called after the ownership value for a foreign key is changed.

(Inherited from ValueGenerationConvention)
ProcessForeignKeyPropertiesChanged(IConventionForeignKeyBuilder, IReadOnlyList<IConventionProperty>, IConventionKey, IConventionContext<IReadOnlyList<IConventionProperty>>)

Called after the foreign key properties or principal key are changed.

(Inherited from ValueGenerationConvention)
ProcessForeignKeyPropertiesChanged(IConventionRelationshipBuilder, IReadOnlyList<IConventionProperty>, IConventionKey, IConventionContext<IConventionRelationshipBuilder>)

Called after the foreign key properties or principal key are changed.

(Inherited from ValueGenerationConvention)
ProcessForeignKeyRemoved(IConventionEntityTypeBuilder, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

Called after a foreign key is removed.

(Inherited from ValueGenerationConvention)
ProcessPropertyAnnotationChanged(IConventionPropertyBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

Called after an annotation is changed on a property.

Applies to