SqlServerValueGenerationStrategyConvention 类

定义

将默认模型 SqlServerValueGenerationStrategy 配置为 IdentityColumn的约定。

public class SqlServerValueGenerationStrategyConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelInitializedConvention
public class SqlServerValueGenerationStrategyConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelInitializedConvention
type SqlServerValueGenerationStrategyConvention = class
    interface IModelInitializedConvention
    interface IConvention
    interface IModelFinalizedConvention
type SqlServerValueGenerationStrategyConvention = class
    interface IModelInitializedConvention
    interface IConvention
    interface IModelFinalizingConvention
Public Class SqlServerValueGenerationStrategyConvention
Implements IModelFinalizedConvention, IModelInitializedConvention
Public Class SqlServerValueGenerationStrategyConvention
Implements IModelFinalizingConvention, IModelInitializedConvention
继承
SqlServerValueGenerationStrategyConvention
实现

注解

有关详细信息和示例,请参阅模型构建约定和使用 EF Core 访问SQL Server和Azure SQL数据库

构造函数

SqlServerValueGenerationStrategyConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies)

创建 SqlServerValueGenerationStrategyConvention 的新实例。

属性

Dependencies

此服务的依赖项。

RelationalDependencies

此服务的关系提供程序特定的依赖项。

方法

ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

在模型最终确定后调用。

ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

在最终确定模型时调用。

ProcessModelInitialized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

在初始化模型后调用。

适用于