ReferenceNavigationBuilder<TEntity, TRelatedEntity> ReferenceNavigationBuilder(Of TEntity, TRelatedEntity) Class

Definition

Provides a simple API for configuring a relationship where configuration began on an end of the relationship with a reference that points to an instance of another entity type.

Instances of this class are returned from methods when using the ModelBuilder API and it is not designed to be directly constructed in your application code.

public class ReferenceNavigationBuilder<TEntity, TRelatedEntity> : ReferenceNavigationBuilder, IInfrastructure<InternalRelationshipBuilder> where TEntity : class where TRelatedEntity : class
Public Class ReferenceNavigationBuilder(Of TEntity As Class, TRelatedEntity As Class)
    Inherits ReferenceNavigationBuilder
    Implements IInfrastructure(Of InternalRelationshipBuilder)
Type Parameters
TEntity

The entity type to be configured.

TRelatedEntity

The entity type that this relationship targets.

Inheritance
System.ObjectSystem.Object
ReferenceNavigationBuilder<TEntity, TRelatedEntity>ReferenceNavigationBuilder(Of TEntity, TRelatedEntity)
Implements

Constructors

ReferenceNavigationBuilder(EntityType, EntityType, PropertyInfo, InternalRelationshipBuilder) ReferenceNavigationBuilder(EntityType, EntityType, PropertyInfo, InternalRelationshipBuilder)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

public ReferenceNavigationBuilder(EntityType declaringEntityType, EntityType relatedEntityType, PropertyInfo navigationProperty, InternalRelationshipBuilder builder)
Public Sub New(declaringEntityType As EntityType, relatedEntityType As EntityType, navigationProperty As PropertyInfo, builder As InternalRelationshipBuilder)
Parameters
declaringEntityType
EntityType EntityType
relatedEntityType
EntityType EntityType
navigationProperty
System.Reflection.PropertyInfo System.Reflection.PropertyInfo

Methods

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

GetHashCode() GetHashCode()

Inherited from System.Object

GetType() GetType()

Inherited from System.Object

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ToString() ToString()

Inherited from System.Object

WithMany(Expression<>>>) WithMany(Expression(Of Func(Of TRelatedEntity, IEnumerable(Of TEntity))))

Configures this as a one-to-many relationship.

public virtual ReferenceCollectionBuilder<TRelatedEntity, TEntity> WithMany(Expression<Func<TRelatedEntity, IEnumerable<TEntity>>> navigationExpression)
Public Overridable Function WithMany(navigationExpression As Expression(Of Func(Of TRelatedEntity, IEnumerable(Of TEntity)))) As ReferenceCollectionBuilder(Of TRelatedEntity, TEntity)
Parameters
navigationExpression
System.Linq.Expressions.Expression<System.Func<TRelatedEntity, System.Collections.Generic.IEnumerable<TEntity>>> System.Linq.Expressions.Expression(Of System.Func(Of TRelatedEntity, System.Collections.Generic.IEnumerable(Of TEntity)))

A lambda expression representing the collection navigation property on the other end of this relationship (blog => blog.Posts). If no property is specified, the relationship will be configured without a navigation property on the other end of the relationship.

Returns
ReferenceCollectionBuilder<TRelatedEntity, TEntity> ReferenceCollectionBuilder(Of TRelatedEntity, TEntity)

An object to further configure the relationship.

WithMany(String) WithMany(String)

Configures this as a one-to-many relationship.

public virtual ReferenceCollectionBuilder<TRelatedEntity, TEntity> WithMany(string navigationName = null)
Public Overridable Function WithMany(navigationName As String = Nothing) As ReferenceCollectionBuilder(Of TRelatedEntity, TEntity)
Parameters
navigationName
System.String System.String

The name of the collection navigation property on the other end of this relationship. If null, there is no navigation property on the other end of the relationship.

Returns
ReferenceCollectionBuilder<TRelatedEntity, TEntity> ReferenceCollectionBuilder(Of TRelatedEntity, TEntity)

An object to further configure the relationship.

WithManyBuilder(PropertyInfo) WithManyBuilder(PropertyInfo)

WithManyBuilder(String) WithManyBuilder(String)

WithOne(Expression<>>) WithOne(Expression(Of Func(Of TRelatedEntity, TEntity)))

Configures this as a one-to-one relationship.

public virtual ReferenceReferenceBuilder<TEntity, TRelatedEntity> WithOne(Expression<Func<TRelatedEntity, TEntity>> navigationExpression)
Public Overridable Function WithOne(navigationExpression As Expression(Of Func(Of TRelatedEntity, TEntity))) As ReferenceReferenceBuilder(Of TEntity, TRelatedEntity)
Parameters
navigationExpression
System.Linq.Expressions.Expression<System.Func<TRelatedEntity, TEntity>> System.Linq.Expressions.Expression(Of System.Func(Of TRelatedEntity, TEntity))

A lambda expression representing the reference navigation property on the other end of this relationship (blog => blog.BlogInfo). If no property is specified, the relationship will be configured without a navigation property on the other end of the relationship.

Returns
ReferenceReferenceBuilder<TEntity, TRelatedEntity> ReferenceReferenceBuilder(Of TEntity, TRelatedEntity)

An object to further configure the relationship.

WithOne(String) WithOne(String)

Configures this as a one-to-one relationship.

public virtual ReferenceReferenceBuilder<TEntity, TRelatedEntity> WithOne(string navigationName = null)
Public Overridable Function WithOne(navigationName As String = Nothing) As ReferenceReferenceBuilder(Of TEntity, TRelatedEntity)
Parameters
navigationName
System.String System.String

The name of the reference navigation property on the other end of this relationship. If null, there is no navigation property on the other end of the relationship.

Returns
ReferenceReferenceBuilder<TEntity, TRelatedEntity> ReferenceReferenceBuilder(Of TEntity, TRelatedEntity)

An object to further configure the relationship.

WithOneBuilder(PropertyInfo) WithOneBuilder(PropertyInfo)

WithOneBuilder(String) WithOneBuilder(String)

Properties

DeclaringEntityType DeclaringEntityType

IInfrastructure.Instance Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure.Instance

ReferenceName ReferenceName

ReferenceProperty ReferenceProperty

RelatedEntityType RelatedEntityType