語言

SqlServerIndexConvention 類別

定義

一種約定,將篩選器配置為唯一且非叢集且欄位可為空的索引,以過濾空值。

[System.Runtime.CompilerServices.Nullable(0)]
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
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
[<System.Runtime.CompilerServices.Nullable(0)>]
type SqlServerIndexConvention = class
    interface IEntityTypeBaseTypeChangedConvention
    interface IConvention
    interface IIndexAddedConvention
    interface IIndexUniquenessChangedConvention
    interface IIndexAnnotationChangedConvention
    interface IPropertyNullabilityChangedConvention
    interface IPropertyAnnotationChangedConvention
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 資料庫。

建構函式

名稱 Description
SqlServerIndexConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies, ISqlGenerationHelper)

建立一個新的 實例。SqlServerIndexConvention

屬性

名稱 Description
Dependencies

此服務的依賴關係。

RelationalDependencies

此服務的關聯提供者專屬相依關係。

方法

名稱 Description
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>)

在屬性的空性變更後呼叫。

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

在屬性的空性變更後呼叫。

適用於