语言

IConventionForeignKeyBuilder.IsRequiredDependent 方法

定义

配置是否需要依赖端(即是否可以分配 null依赖导航的主体)。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? IsRequiredDependent(bool? required, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder IsRequiredDependent(bool? required, bool fromDataAnnotation = false);
abstract member IsRequiredDependent : Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function IsRequiredDependent (required As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

参数

required
Nullable<Boolean>

一个值,该值指示是否需要依赖端。 若要重置为默认值,则为 。

fromDataAnnotation
Boolean

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

返回

如果配置了依赖端必需,则为同一生成器实例,否则为同一 null 个生成器实例。

适用于