IConventionRelationshipBuilder.HasForeignKey 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
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.IConventionRelationshipBuilder 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.IConventionRelationshipBuilder
Public Function HasForeignKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As IConventionRelationshipBuilder
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
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.IConventionRelationshipBuilder HasForeignKey (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
abstract member HasForeignKey : System.Collections.Generic.IReadOnlyList<string> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder
Public Function HasForeignKey (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As IConventionRelationshipBuilder
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
The same builder instance if the properties were configured as the foreign key,
null
otherwise.
Applies to
Entity Framework