IConventionEntityTypeBuilder.GetTargetEntityTypeBuilder 方法

定义

获取或创建潜在导航目标的生成器。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? GetTargetEntityTypeBuilder (Type targetClrType, System.Reflection.MemberInfo navigationInfo, bool createIfMissing = true, bool? targetShouldBeOwned = default, bool fromDataAnnotation = false);
abstract member GetTargetEntityTypeBuilder : Type * System.Reflection.MemberInfo * bool * Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
Public Function GetTargetEntityTypeBuilder (targetClrType As Type, navigationInfo As MemberInfo, Optional createIfMissing As Boolean = true, Optional targetShouldBeOwned As Nullable(Of Boolean) = Nothing, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder

参数

targetClrType
Type

目标的 CLR 类型。

navigationInfo
MemberInfo

导航属性。

createIfMissing
Boolean

如果当前不在模型中,是否应创建实体类型。

targetShouldBeOwned
Nullable<Boolean>

是否应拥有目标。 null 如果可以是,则为 。

fromDataAnnotation
Boolean

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

返回

实体类型生成器; null 如果未找到且无法创建,则为 。

适用于