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

Definition

Provides a simple API for configuring a relationship where configuration began on an end of the relationship with a collection that contains instances 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 CollectionNavigationBuilder<TEntity, TRelatedEntity> : CollectionNavigationBuilder, IInfrastructure<InternalRelationshipBuilder> where TEntity : class where TRelatedEntity : class
Public Class CollectionNavigationBuilder(Of TEntity As Class, TRelatedEntity As Class)
    Inherits CollectionNavigationBuilder
    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
CollectionNavigationBuilder<TEntity, TRelatedEntity>CollectionNavigationBuilder(Of TEntity, TRelatedEntity)
Implements

Constructors

CollectionNavigationBuilder(EntityType, EntityType, PropertyInfo, InternalRelationshipBuilder) CollectionNavigationBuilder(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 CollectionNavigationBuilder(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

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

Configures this as a one-to-many relationship.

public virtual ReferenceCollectionBuilder<TEntity, TRelatedEntity> WithOne(Expression<Func<TRelatedEntity, TEntity>> navigationExpression)
Public Overridable Function WithOne(navigationExpression As Expression(Of Func(Of TRelatedEntity, TEntity))) As ReferenceCollectionBuilder(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 (post => post.Blog). If no property is specified, the relationship will be configured without a navigation property on the other end of the relationship.

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

An object to further configure the relationship.

WithOne(String) WithOne(String)

Configures this as a one-to-many relationship.

public virtual ReferenceCollectionBuilder<TEntity, TRelatedEntity> WithOne(string navigationName = null)
Public Overridable Function WithOne(navigationName As String = Nothing) As ReferenceCollectionBuilder(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
ReferenceCollectionBuilder<TEntity, TRelatedEntity> ReferenceCollectionBuilder(Of TEntity, TRelatedEntity)

An object to further configure the relationship.

WithOneBuilder(PropertyInfo) WithOneBuilder(PropertyInfo)

WithOneBuilder(String) WithOneBuilder(String)

Properties

CollectionName CollectionName

CollectionProperty CollectionProperty

DeclaringEntityType DeclaringEntityType

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

RelatedEntityType RelatedEntityType