IConventionForeignKeyBuilder.HasForeignKey 方法

定义

重载

HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

配置属性以用作此关系的外键。

HasForeignKey(IReadOnlyList<String>, Boolean)

配置属性以用作此关系的外键。

HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

Source:
IConventionForeignKeyBuilder.cs
Source:
IConventionForeignKeyBuilder.cs
Source:
IConventionForeignKeyBuilder.cs

配置属性以用作此关系的外键。

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

参数

properties
IReadOnlyList<IConventionProperty>

要用作此关系的外键的属性。

fromDataAnnotation
Boolean

指示是否使用数据注释指定配置。

返回

如果属性配置为外键,则为同一生成器实例, null 否则为 。

适用于

HasForeignKey(IReadOnlyList<String>, Boolean)

Source:
IConventionForeignKeyBuilder.cs
Source:
IConventionForeignKeyBuilder.cs
Source:
IConventionForeignKeyBuilder.cs

配置属性以用作此关系的外键。

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

参数

propertyNames
IReadOnlyList<String>

要用作此关系的外键的属性。

fromDataAnnotation
Boolean

指示是否使用数据注释指定配置。

返回

如果属性配置为外键,则为同一生成器实例, null 否则为 。

适用于