SqlServerIndexConvention 類別

定義

設定具有可為 Null 資料行之唯一非叢集索引篩選準則的慣例,以篩選出 Null 值。

public class SqlServerIndexConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IIndexAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IIndexAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IIndexUniquenessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyNullabilityChangedConvention
type SqlServerIndexConvention = class
    interface IEntityTypeBaseTypeChangedConvention
    interface IConvention
    interface IIndexAddedConvention
    interface IIndexUniquenessChangedConvention
    interface IIndexAnnotationChangedConvention
    interface IPropertyNullabilityChangedConvention
    interface IPropertyAnnotationChangedConvention
Public Class SqlServerIndexConvention
Implements IEntityTypeBaseTypeChangedConvention, IIndexAddedConvention, IIndexAnnotationChangedConvention, IIndexUniquenessChangedConvention, IPropertyAnnotationChangedConvention, IPropertyNullabilityChangedConvention
繼承
SqlServerIndexConvention
實作

備註

如需詳細資訊和範例,請參閱使用 EF Core建立模型慣例存取SQL Server和Azure SQL資料庫

建構函式

SqlServerIndexConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies, ISqlGenerationHelper)

建立 SqlServerIndexConvention 的新執行個體。

屬性

Dependencies

此服務的相依性。

RelationalDependencies

此服務的關聯式提供者特定相依性。

方法

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

在實體類型的基底類型變更之後呼叫。

ProcessIndexAdded(IConventionIndexBuilder, IConventionContext<IConventionIndexBuilder>)

在索引新增至實體類型之後呼叫。

ProcessIndexAnnotationChanged(IConventionIndexBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

在索引上變更注釋之後呼叫。

ProcessIndexUniquenessChanged(IConventionIndexBuilder, IConventionContext<IConventionIndexBuilder>)

變更索引的唯一性之後呼叫。

ProcessIndexUniquenessChanged(IConventionIndexBuilder, IConventionContext<Nullable<Boolean>>)

變更索引的唯一性之後呼叫。

ProcessPropertyAnnotationChanged(IConventionPropertyBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

在屬性上變更批註之後呼叫。

ProcessPropertyNullabilityChanged(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

在屬性的可為 Null 性變更之後呼叫。

ProcessPropertyNullabilityChanged(IConventionPropertyBuilder, IConventionContext<Nullable<Boolean>>)

在屬性的可為 Null 性變更之後呼叫。

適用於