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

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.

Syntax

Declaration

public class CollectionNavigationBuilder<TEntity, TRelatedEntity> : CollectionNavigationBuilder, IInfrastructure<InternalRelationshipBuilder> where TEntity : class where TRelatedEntity : classPublic 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 Hierarchy

Inherited Members

CollectionName,
CollectionName,
CollectionProperty,
CollectionProperty,
RelatedEntityType,
RelatedEntityType,
DeclaringEntityType,
DeclaringEntityType,
IInfrastructure<InternalRelationshipBuilder>.Instance,
Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Internal.InternalRelationshipBuilder>.Instance,
WithOneBuilder(String),
WithOneBuilder(String),
WithOneBuilder(PropertyInfo),
WithOneBuilder(PropertyInfo),
ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Constructors summary

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.

Methods summary

Configures this as a one-to-many relationship.

Configures this as a one-to-many relationship.

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

Methods

  • WithOne(Expression<Func<TRelatedEntity, TEntity>>)
    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<TDelegate><System.Func<T, TResult><TRelatedEntity, TEntity>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(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

  • 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

Details

Assembly

Microsoft.EntityFrameworkCore.dll