RelationshipDiscoveryConvention.TryGetTargetEntityTypeBuilder Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Finds or tries to create an entity type target for the given navigation member.
protected virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? TryGetTargetEntityTypeBuilder (Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, Type targetClrType, System.Reflection.MemberInfo navigationMemberInfo, bool? shouldBeOwned = default, bool shouldCreate = true);
abstract member TryGetTargetEntityTypeBuilder : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder * Type * System.Reflection.MemberInfo * Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
override this.TryGetTargetEntityTypeBuilder : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder * Type * System.Reflection.MemberInfo * Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
Protected Overridable Function TryGetTargetEntityTypeBuilder (entityTypeBuilder As IConventionEntityTypeBuilder, targetClrType As Type, navigationMemberInfo As MemberInfo, Optional shouldBeOwned As Nullable(Of Boolean) = Nothing, Optional shouldCreate As Boolean = true) As IConventionEntityTypeBuilder
Parameters
- entityTypeBuilder
- IConventionEntityTypeBuilder
The builder for the referencing entity type.
- targetClrType
- Type
The CLR type of the target entity type.
- navigationMemberInfo
- MemberInfo
The navigation member.
- shouldCreate
- Boolean
Whether an entity type should be created if one doesn't currently exist.
Returns
The builder for the target entity type or null
if it can't be created.
Applies to
Entity Framework
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for