PropertyExtensions.IsForeignKey(IProperty) Method

Definition

Caution

Use IReadOnlyProperty.IsForeignKey

Gets a value indicating whether this property is used as a foreign key (or part of a composite foreign key).

C#
public static bool IsForeignKey (this Microsoft.EntityFrameworkCore.Metadata.IProperty property);
C#
[System.Obsolete("Use IReadOnlyProperty.IsForeignKey")]
public static bool IsForeignKey (this Microsoft.EntityFrameworkCore.Metadata.IProperty property);

Parameters

property
IProperty

The property to check.

Returns

true if the property is used as a foreign key, otherwise false.

Attributes

Applies to

Product Versions (Obsolete)
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0 (6.0)