RelationalForeignKeyExtensions.GetConstraintName Method

Definition

Overloads

GetConstraintName(IForeignKey)

Returns the foreign key constraint name.

GetConstraintName(IReadOnlyForeignKey)

Returns the foreign key constraint name.

GetConstraintName(IForeignKey, StoreObjectIdentifier, StoreObjectIdentifier)

Returns the foreign key constraint name.

GetConstraintName(IReadOnlyForeignKey, StoreObjectIdentifier, StoreObjectIdentifier)

Returns the foreign key constraint name.

GetConstraintName(IForeignKey)

Source:
RelationalForeignKeyExtensions.cs
Source:
RelationalForeignKeyExtensions.cs
Source:
RelationalForeignKeyExtensions.cs

Returns the foreign key constraint name.

C#
public static string GetConstraintName (this Microsoft.EntityFrameworkCore.Metadata.IForeignKey foreignKey);

Parameters

foreignKey
IForeignKey

The foreign key.

Returns

The foreign key constraint name.

Applies to

Entity Framework Core 5.0 and other versions
Product Versions
Entity Framework Core 3.0, 3.1, 5.0

GetConstraintName(IReadOnlyForeignKey)

Source:
RelationalForeignKeyExtensions.cs
Source:
RelationalForeignKeyExtensions.cs
Source:
RelationalForeignKeyExtensions.cs
Source:
RelationalForeignKeyExtensions.cs

Returns the foreign key constraint name.

C#
public static string? GetConstraintName (this Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey foreignKey);

Parameters

foreignKey
IReadOnlyForeignKey

The foreign key.

Returns

The foreign key constraint name.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 6.0, 7.0, 8.0, 9.0

GetConstraintName(IForeignKey, StoreObjectIdentifier, StoreObjectIdentifier)

Source:
RelationalForeignKeyExtensions.cs

Returns the foreign key constraint name.

C#
public static string GetConstraintName (this Microsoft.EntityFrameworkCore.Metadata.IForeignKey foreignKey, in Microsoft.EntityFrameworkCore.Metadata.StoreObjectIdentifier storeObject, in Microsoft.EntityFrameworkCore.Metadata.StoreObjectIdentifier principalStoreObject);

Parameters

foreignKey
IForeignKey

The foreign key.

storeObject
StoreObjectIdentifier

The identifier of the containing store object.

principalStoreObject
StoreObjectIdentifier

The identifier of the principal store object.

Returns

The foreign key constraint name.

Applies to

Entity Framework Core 5.0
Product Versions
Entity Framework Core 5.0

GetConstraintName(IReadOnlyForeignKey, StoreObjectIdentifier, StoreObjectIdentifier)

Source:
RelationalForeignKeyExtensions.cs
Source:
RelationalForeignKeyExtensions.cs
Source:
RelationalForeignKeyExtensions.cs
Source:
RelationalForeignKeyExtensions.cs

Returns the foreign key constraint name.

C#
public static string? GetConstraintName (this Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey foreignKey, in Microsoft.EntityFrameworkCore.Metadata.StoreObjectIdentifier storeObject, in Microsoft.EntityFrameworkCore.Metadata.StoreObjectIdentifier principalStoreObject);

Parameters

foreignKey
IReadOnlyForeignKey

The foreign key.

storeObject
StoreObjectIdentifier

The identifier of the containing store object.

principalStoreObject
StoreObjectIdentifier

The identifier of the principal store object.

Returns

The foreign key constraint name.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 6.0, 7.0, 8.0, 9.0