Idioma

KeyAttributeConvention Classe

Definição

Uma convenção que configura a chave de tipo de entidade com base na KeyAttribute propriedade especificada em uma propriedade ou PrimaryKeyAttribute especificada em um tipo CLR.

[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1 })]
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
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
[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1 })>]
type KeyAttributeConvention = class
    inherit PropertyAttributeConventionBase<KeyAttribute>
    interface IModelFinalizingConvention
    interface IConvention
    interface IEntityTypeAddedConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface IComplexPropertyAddedConvention
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
Public Class KeyAttributeConvention
Inherits PropertyAttributeConventionBase(Of KeyAttribute)
Implements IComplexPropertyAddedConvention, IEntityTypeAddedConvention, IEntityTypeBaseTypeChangedConvention, IModelFinalizingConvention
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
Herança
Atributos
Implementações

Comentários

Consulte as convenções de criação de modelos para obter mais informações e exemplos.

Construtores

Nome Descrição
KeyAttributeConvention(ProviderConventionSetBuilderDependencies)

Cria uma nova instância de KeyAttributeConvention.

Propriedades

Nome Descrição
Dependencies

Dependências para esse serviço.

(Herdado de PropertyAttributeConventionBase<TAttribute>)

Métodos

Nome Descrição
ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder, IConventionContext<IConventionComplexPropertyBuilder>)

Chamado depois que uma propriedade complexa é adicionada a um objeto semelhante a um tipo.

(Herdado de PropertyAttributeConventionBase<TAttribute>)
ProcessComplexPropertyFieldChanged(IConventionComplexPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

Chamado depois que o campo de backup de uma propriedade complexa é alterado.

(Herdado de PropertyAttributeConventionBase<TAttribute>)
ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

Chamado depois que um tipo de entidade é adicionado ao modelo.

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

Chamado após o tipo base de um tipo de entidade ser alterado.

ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

Chamado depois que um modelo é finalizado.

ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

Chamado quando um modelo está sendo finalizado.

ProcessPropertyAdded(IConventionComplexPropertyBuilder, KeyAttribute, MemberInfo, IConventionContext)

Chamado depois que uma propriedade complexa é adicionada a um tipo com um atributo na propriedade ou campo CLR associado.

ProcessPropertyAdded(IConventionComplexPropertyBuilder, TAttribute, MemberInfo, IConventionContext)

Chamado depois que uma propriedade complexa é adicionada a um tipo com um atributo na propriedade ou campo CLR associado.

(Herdado de PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

Chamado depois que uma propriedade é adicionada ao tipo de entidade.

(Herdado de PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionPropertyBuilder, KeyAttribute, MemberInfo, IConventionContext)

Chamado depois que uma propriedade é adicionada ao tipo de entidade com um atributo na propriedade ou campo CLR associado.

ProcessPropertyAdded(IConventionPropertyBuilder, TAttribute, MemberInfo, IConventionContext)

Chamado depois que uma propriedade é adicionada ao tipo de entidade com um atributo na propriedade ou campo CLR associado.

(Herdado de PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyFieldChanged(IConventionPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

Chamado depois que o campo de backup de uma propriedade é alterado.

(Herdado de PropertyAttributeConventionBase<TAttribute>)

Aplica-se a