IConventionForeignKeyBuilder.HasNavigation 方法

定义

重载

HasNavigation(MemberInfo, Boolean, Boolean)

将给定属性配置为此关系使用的导航属性。

HasNavigation(String, Boolean, Boolean)

将具有给定名称的属性配置为此关系使用的导航属性。

HasNavigation(MemberInfo, Boolean, Boolean)

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

将给定属性配置为此关系使用的导航属性。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasNavigation (System.Reflection.MemberInfo property, bool pointsToPrincipal, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasNavigation (System.Reflection.MemberInfo? property, bool pointsToPrincipal, bool fromDataAnnotation = false);
abstract member HasNavigation : System.Reflection.MemberInfo * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasNavigation (property As MemberInfo, pointsToPrincipal As Boolean, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

参数

property
MemberInfo

要使用的 属性。

pointsToPrincipal
Boolean

一个值,该值指示导航是否位于指向主体类型的依赖类型上。

fromDataAnnotation
Boolean

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

返回

如果配置了导航属性,则为同一生成器实例, null 否则为 。

适用于

HasNavigation(String, Boolean, Boolean)

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

将具有给定名称的属性配置为此关系使用的导航属性。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasNavigation (string name, bool pointsToPrincipal, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasNavigation (string? name, bool pointsToPrincipal, bool fromDataAnnotation = false);
abstract member HasNavigation : string * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasNavigation (name As String, pointsToPrincipal As Boolean, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

参数

name
String

要使用的属性的名称。

pointsToPrincipal
Boolean

一个值,该值指示导航是否位于指向主体类型的依赖类型上。

fromDataAnnotation
Boolean

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

返回

如果配置了导航属性,则为同一生成器实例, null 否则为 。

适用于