DbCollectionEntry<TEntity, TElement> Class

Instances of this class are returned from the Collection method of DbEntityEntry<TEntity> and allow operations such as loading to be performed on the entity's collection navigation properties.

  System.Data.Entity.Infrastructure.DbMemberEntry<TEntity, ICollection<TElement>>
    System.Data.Entity.Infrastructure.DbCollectionEntry<TEntity, TElement>

Namespace:  System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

public class DbCollectionEntry<TEntity, TElement> : DbMemberEntry<TEntity, ICollection<TElement>>
where TEntity : class

Type Parameters


The type of the entity to which this property belongs.


The type of the element in the collection of entities.

The DbCollectionEntry<TEntity, TElement> type exposes the following members.

Public propertyCurrentValueGets or sets the current value of the navigation property. The current value is the entity that the navigation property references. (Overrides DbMemberEntry<TEntity, TProperty>.CurrentValue.)
Public propertyEntityEntryThe DbEntityEntry<TEntity> to which this navigation property belongs. (Overrides DbMemberEntry<TEntity, TProperty>.EntityEntry.)
Public propertyIsLoadedGets a value indicating whether the collection of entities has been loaded from the database.
Public propertyNameGets the property name. (Overrides DbMemberEntry<TEntity, TProperty>.Name.)

Public methodEqualsReturns whether the specified query is equal to the current query. (Inherited from DbMemberEntry<TEntity, TProperty>.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCodeReturns the hash function for the specified query. (Inherited from DbMemberEntry<TEntity, TProperty>.)
Public methodGetTypeGets the type for the current query. (Inherited from DbMemberEntry<TEntity, TProperty>.)
Public methodGetValidationErrorsValidates this property. (Inherited from DbMemberEntry<TEntity, TProperty>.)
Public methodLoadLoads the collection of entities from the database. Note that entities that already exist in the context are not overwritten with values from the database.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodQueryReturns the query that would be used to load this collection from the database. The returned query can be modified using LINQ to perform filtering or operations in the database, such as counting the number of entities in the collection in the database without actually loading them.
Public methodToStringReturns a string representation of the database property values. (Inherited from DbMemberEntry<TEntity, TProperty>.)

Public operatorStatic memberImplicit(DbCollectionEntry<TEntity, TElement> to DbCollectionEntry)Returns a new instance of the non-generic DbCollectionEntry class for the navigation property represented by this object.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.