IReadOnlyEntityType.FindForeignKey Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType) |
Gets the foreign key for the given properties that points to a given primary or alternate key. Returns |
FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType) |
Gets the foreign key for the given properties that points to a given primary or alternate key.
Returns |
FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType)
Gets the foreign key for the given properties that points to a given primary or alternate key. Returns null
if no foreign key is found.
public virtual Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey? FindForeignKey (Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty property, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType principalEntityType);
abstract member FindForeignKey : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey
override this.FindForeignKey : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey
Public Overridable Function FindForeignKey (property As IReadOnlyProperty, principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IReadOnlyForeignKey
Parameters
- property
- IReadOnlyProperty
The property that the foreign key is defined on.
- principalKey
- IReadOnlyKey
The primary or alternate key that is referenced.
- principalEntityType
- IReadOnlyEntityType
The entity type that the relationship targets. This may be different from the type that principalKey
is defined on when the relationship targets a derived type in an inheritance hierarchy (since the key is defined on the
base type of the hierarchy).
Returns
The foreign key, or null
if none is defined.
Applies to
FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType)
Gets the foreign key for the given properties that points to a given primary or alternate key.
Returns null
if no foreign key is found.
public Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey? FindForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType principalEntityType);
abstract member FindForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey
Public Function FindForeignKey (properties As IReadOnlyList(Of IReadOnlyProperty), principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IReadOnlyForeignKey
Parameters
- properties
- IReadOnlyList<IReadOnlyProperty>
The properties that the foreign key is defined on.
- principalKey
- IReadOnlyKey
The primary or alternate key that is referenced.
- principalEntityType
- IReadOnlyEntityType
The entity type that the relationship targets. This may be different from the type that principalKey
is defined on when the relationship targets a derived type in an inheritance hierarchy (since the key is defined on the
base type of the hierarchy).
Returns
The foreign key, or null
if none is defined.
Applies to
Entity Framework