ValueGenerationConvention 类

定义

一种约定,该约定将存储值生成配置为 OnAdd 在属于主键而不是任何外键一部分的属性上。

public class ValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypePrimaryKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPropertiesChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention
public class ValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypePrimaryKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyOwnershipChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPropertiesChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention
type ValueGenerationConvention = class
    interface IEntityTypePrimaryKeyChangedConvention
    interface IConvention
    interface IForeignKeyAddedConvention
    interface IForeignKeyRemovedConvention
    interface IForeignKeyPropertiesChangedConvention
    interface IEntityTypeBaseTypeChangedConvention
type ValueGenerationConvention = class
    interface IEntityTypePrimaryKeyChangedConvention
    interface IConvention
    interface IForeignKeyAddedConvention
    interface IForeignKeyRemovedConvention
    interface IForeignKeyPropertiesChangedConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface IForeignKeyOwnershipChangedConvention
Public Class ValueGenerationConvention
Implements IEntityTypeBaseTypeChangedConvention, IEntityTypePrimaryKeyChangedConvention, IForeignKeyAddedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyRemovedConvention
Public Class ValueGenerationConvention
Implements IEntityTypeBaseTypeChangedConvention, IEntityTypePrimaryKeyChangedConvention, IForeignKeyAddedConvention, IForeignKeyOwnershipChangedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyRemovedConvention
继承
ValueGenerationConvention
派生
实现

注解

有关详细信息和示例,请参阅 模型生成约定

构造函数

ValueGenerationConvention(ProviderConventionSetBuilderDependencies)

创建 ValueGenerationConvention 的新实例。

属性

Dependencies

此服务的依赖项。

方法

GetValueGenerated(IConventionProperty)

返回为给定属性设置的存储值生成策略。

GetValueGenerated(IProperty)

返回为给定属性设置的存储值生成策略。

GetValueGenerated(IReadOnlyProperty)

返回为给定属性设置的存储值生成策略。

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

在实体类型的基类型更改后调用。

ProcessEntityTypePrimaryKeyChanged(IConventionEntityTypeBuilder, IConventionKey, IConventionKey, IConventionContext<IConventionKey>)

在实体类型的主键更改后调用。

ProcessForeignKeyAdded(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

在将外键添加到实体类型后调用。

ProcessForeignKeyAdded(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

在将外键添加到实体类型后调用。

ProcessForeignKeyOwnershipChanged(IConventionForeignKeyBuilder, IConventionContext<Nullable<Boolean>>)

在更改外键的所有权值后调用。

ProcessForeignKeyPropertiesChanged(IConventionForeignKeyBuilder, IReadOnlyList<IConventionProperty>, IConventionKey, IConventionContext<IReadOnlyList<IConventionProperty>>)

在更改外键属性或主体键后调用。

ProcessForeignKeyPropertiesChanged(IConventionRelationshipBuilder, IReadOnlyList<IConventionProperty>, IConventionKey, IConventionContext<IConventionRelationshipBuilder>)

在更改外键属性或主体键后调用。

ProcessForeignKeyRemoved(IConventionEntityTypeBuilder, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

在删除外键后调用。

适用于