语言

SqlServerIndexConvention 类

定义

一种约定,用于为具有可为 null 列的唯一非聚集索引配置筛选器,以筛选出 null 值。

[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数据库。

构造函数

名称 说明
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 性后调用。

适用于