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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework