KeyAttributeConvention 类

定义

一种约定,用于根据 KeyAttribute 属性上指定的 或 PrimaryKeyAttribute CLR 类型上指定的 来配置实体类型键。

public class KeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.PropertyAttributeConventionBase<System.ComponentModel.DataAnnotations.KeyAttribute>, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizedConvention
public class KeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.PropertyAttributeConventionBase<System.ComponentModel.DataAnnotations.KeyAttribute>, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention
public class KeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.PropertyAttributeConventionBase<System.ComponentModel.DataAnnotations.KeyAttribute>, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention
public class KeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.PropertyAttributeConventionBase<System.ComponentModel.DataAnnotations.KeyAttribute>, Microsoft.EntityFrameworkCore.Metadata.Conventions.IComplexPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention
type KeyAttributeConvention = class
    inherit PropertyAttributeConventionBase<KeyAttribute>
    interface IModelFinalizedConvention
    interface IConvention
type KeyAttributeConvention = class
    inherit PropertyAttributeConventionBase<KeyAttribute>
    interface IModelFinalizingConvention
    interface IConvention
type KeyAttributeConvention = class
    inherit PropertyAttributeConventionBase<KeyAttribute>
    interface IModelFinalizingConvention
    interface IConvention
    interface IEntityTypeAddedConvention
    interface IEntityTypeBaseTypeChangedConvention
type KeyAttributeConvention = class
    inherit PropertyAttributeConventionBase<KeyAttribute>
    interface IModelFinalizingConvention
    interface IConvention
    interface IEntityTypeAddedConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface IComplexPropertyAddedConvention
Public Class KeyAttributeConvention
Inherits PropertyAttributeConventionBase(Of KeyAttribute)
Implements IModelFinalizedConvention
Public Class KeyAttributeConvention
Inherits PropertyAttributeConventionBase(Of KeyAttribute)
Implements IModelFinalizingConvention
Public Class KeyAttributeConvention
Inherits PropertyAttributeConventionBase(Of KeyAttribute)
Implements IEntityTypeAddedConvention, IEntityTypeBaseTypeChangedConvention, IModelFinalizingConvention
Public Class KeyAttributeConvention
Inherits PropertyAttributeConventionBase(Of KeyAttribute)
Implements IComplexPropertyAddedConvention, IEntityTypeAddedConvention, IEntityTypeBaseTypeChangedConvention, IModelFinalizingConvention
继承
实现

注解

有关详细信息和示例,请参阅 模型生成约定

构造函数

KeyAttributeConvention(ProviderConventionSetBuilderDependencies)

创建 KeyAttributeConvention 的新实例。

属性

Dependencies

此服务的依赖项。

(继承自 PropertyAttributeConventionBase<TAttribute>)

方法

ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder, IConventionContext<IConventionComplexPropertyBuilder>)

在将复杂属性添加到类似类型的对象之后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessComplexPropertyFieldChanged(IConventionComplexPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

在更改复杂属性的后备字段后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

在实体类型添加到模型后调用。

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

在实体类型的基类型更改后调用。

ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

在模型完成后调用。

ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

在最终确定模型时调用。

ProcessPropertyAdded(IConventionComplexPropertyBuilder, KeyAttribute, MemberInfo, IConventionContext)

一种约定,用于根据 KeyAttribute 属性上指定的 或 PrimaryKeyAttribute CLR 类型上指定的 来配置实体类型键。

ProcessPropertyAdded(IConventionComplexPropertyBuilder, TAttribute, MemberInfo, IConventionContext)

在将复杂属性添加到具有关联 CLR 属性或字段特性的类型后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

在将属性添加到实体类型后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionPropertyBuilder, KeyAttribute, MemberInfo, IConventionContext)

在将属性添加到具有关联 CLR 属性或字段特性的实体类型后调用。

ProcessPropertyAdded(IConventionPropertyBuilder, TAttribute, MemberInfo, IConventionContext)

在将属性添加到具有关联 CLR 属性或字段特性的实体类型后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyFieldChanged(IConventionPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

在属性的后备字段更改后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)

适用于