IConventionForeignKeyBuilder.HasForeignKey Method

Definition

Overloads

HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

Configures the properties to use as the foreign key for this relationship.

HasForeignKey(IReadOnlyList<String>, Boolean)

Configures the properties to use as the foreign key for this relationship.

HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

Configures the properties to use as the foreign key for this relationship.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>? properties, bool fromDataAnnotation = false);
abstract member HasForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasForeignKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

Parameters

properties
IReadOnlyList<IConventionProperty>

The properties to use as the foreign key for this relationship.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionForeignKeyBuilder

The same builder instance if the properties were configured as the foreign key, null otherwise.

Applies to

HasForeignKey(IReadOnlyList<String>, Boolean)

Configures the properties to use as the foreign key for this relationship.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasForeignKey (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasForeignKey (System.Collections.Generic.IReadOnlyList<string>? propertyNames, bool fromDataAnnotation = false);
abstract member HasForeignKey : System.Collections.Generic.IReadOnlyList<string> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasForeignKey (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

Parameters

propertyNames
IReadOnlyList<String>

The properties to use as the foreign key for this relationship.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionForeignKeyBuilder

The same builder instance if the properties were configured as the foreign key, null otherwise.

Applies to