共用方式為


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

在初始化模型之後呼叫。

適用於