Partager via


RuntimeEntityType.IEntityType.FindForeignKey Méthode

Définition

Obtient la clé étrangère pour les propriétés données qui pointe vers une clé primaire ou secondaire donnée. Retourne null si aucune clé étrangère n’est trouvée.

[System.Diagnostics.DebuggerStepThrough]
Microsoft.EntityFrameworkCore.Metadata.IForeignKey? IEntityType.FindForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType principalEntityType);
[System.Diagnostics.DebuggerStepThrough]
Microsoft.EntityFrameworkCore.Metadata.IForeignKey IEntityType.FindForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType principalEntityType);
[<System.Diagnostics.DebuggerStepThrough>]
abstract member Microsoft.EntityFrameworkCore.Metadata.IEntityType.FindForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IForeignKey
override this.Microsoft.EntityFrameworkCore.Metadata.IEntityType.FindForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IForeignKey
Function FindForeignKey (properties As IReadOnlyList(Of IReadOnlyProperty), principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IForeignKey Implements IEntityType.FindForeignKey

Paramètres

properties
IReadOnlyList<IReadOnlyProperty>

Propriétés sur laquelle la clé étrangère est définie.

principalKey
IReadOnlyKey

Clé primaire ou secondaire référencée.

principalEntityType
IReadOnlyEntityType

Type d'entité ciblé par la relation. Cela peut être différent du type défini sur lorsque la relation cible un type dérivé dans une hiérarchie d’héritage (étant donné que principalKey la clé est définie sur le type de base de la hiérarchie).

Retours

La clé étrangère, ou null si aucune n’est définie.

Implémente

Attributs

S’applique à