ConventionEntityTypeExtensions.FindKey Method

Definition

Gets the primary or alternate key that is defined on the given property. Returns null if no key is defined for the given property.

public static Microsoft.EntityFrameworkCore.Metadata.IConventionKey FindKey (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, Microsoft.EntityFrameworkCore.Metadata.IProperty property);
static member FindKey : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * Microsoft.EntityFrameworkCore.Metadata.IProperty -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
<Extension()>
Public Function FindKey (entityType As IConventionEntityType, property As IProperty) As IConventionKey

Parameters

entityType
IConventionEntityType

The entity type.

property
IProperty

The property that the key is defined on.

Returns

The key, or null if none is defined.

Applies to