IConventionEntityTypeBuilder.GetTargetEntityTypeBuilder Method

Definition

Gets or creates a builder for the target of a potential navigation.

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

Parameters

targetClrType
Type

The CLR type of the target.

navigationInfo
MemberInfo

The navigation property.

createIfMissing
Boolean

Whether the entity type should be created if currently not in the model.

targetShouldBeOwned
Nullable<Boolean>

Whether the target should be owned. null if it can be either.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The entity type builder or null if not found and can't be created.

Applies to