Langue

KeyAttributeConvention Classe

Définition

Convention qui configure la clé de type d’entité en fonction de la KeyAttribute propriété spécifiée ou PrimaryKeyAttribute spécifiée sur un type 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
Héritage
Attributs
Implémente

Remarques

Pour plus d’informations et d’exemples, consultez les conventions de génération de modèles.

Constructeurs

Nom Description
KeyAttributeConvention(ProviderConventionSetBuilderDependencies)

Crée une instance de KeyAttributeConvention.

Propriétés

Nom Description
Dependencies

Dépendances pour ce service.

(Hérité de PropertyAttributeConventionBase<TAttribute>)

Méthodes

Nom Description
ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder, IConventionContext<IConventionComplexPropertyBuilder>)

Appelé après l’ajout d’une propriété complexe à un objet de type.

(Hérité de PropertyAttributeConventionBase<TAttribute>)
ProcessComplexPropertyFieldChanged(IConventionComplexPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

Appelé après la modification du champ de stockage d’une propriété complexe.

(Hérité de PropertyAttributeConventionBase<TAttribute>)
ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

Appelé après l’ajout d’un type d’entité au modèle.

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

Appelé après le type de base d’un type d’entité change.

ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

Appelé après la finalisation d’un modèle.

ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

Appelé lorsqu’un modèle est finalisé.

ProcessPropertyAdded(IConventionComplexPropertyBuilder, KeyAttribute, MemberInfo, IConventionContext)

Appelé après l’ajout d’une propriété complexe à un type avec un attribut sur la propriété ou le champ CLR associé.

ProcessPropertyAdded(IConventionComplexPropertyBuilder, TAttribute, MemberInfo, IConventionContext)

Appelé après l’ajout d’une propriété complexe à un type avec un attribut sur la propriété ou le champ CLR associé.

(Hérité de PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

Appelé après l’ajout d’une propriété au type d’entité.

(Hérité de PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionPropertyBuilder, KeyAttribute, MemberInfo, IConventionContext)

Appelée après l’ajout d’une propriété au type d’entité avec un attribut sur la propriété ou le champ CLR associé.

ProcessPropertyAdded(IConventionPropertyBuilder, TAttribute, MemberInfo, IConventionContext)

Appelée après l’ajout d’une propriété au type d’entité avec un attribut sur la propriété ou le champ CLR associé.

(Hérité de PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyFieldChanged(IConventionPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

Appelé après la modification du champ de stockage d’une propriété.

(Hérité de PropertyAttributeConventionBase<TAttribute>)

S’applique à