Share via


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

public class SqlServerValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationalValueGenerationConvention
type SqlServerValueGenerationConvention = class
    inherit RelationalValueGenerationConvention
Public Class SqlServerValueGenerationConvention
Inherits RelationalValueGenerationConvention
Inheritance

Remarks

See Model building conventions, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.

Constructors

SqlServerValueGenerationConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies)

Creates a new instance of SqlServerValueGenerationConvention.

Properties

Dependencies

Dependencies for this service.

(Inherited from ValueGenerationConvention)
RelationalDependencies

Relational provider-specific dependencies for this service.

(Inherited from RelationalValueGenerationConvention)

Methods

GetValueGenerated(IConventionProperty)

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(IProperty)

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.

(Inherited from RelationalValueGenerationConvention)
ProcessEntityTypeAnnotationChanged(IConventionEntityTypeBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

Called after an annotation is changed on an entity.

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

Called after an annotation is changed on an entity type.

(Inherited from RelationalValueGenerationConvention)
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