DbEntityEntry<TEntity>.Collection Method
Gets an object that represents the collection navigation property from this entity to a collection of related entities.
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() | Collection(String) | Gets an object that represents the collection navigation property from this entity to a collection of related entities. |
![]() | Collection<TElement>(Expression<Func<TEntity, ICollection<TElement>>>) | Gets an object that represents the collection navigation property from this entity to a collection of related entities. |
![]() | Collection<TElement>(String) | Gets an object that represents the collection navigation property from this entity to a collection of related entities. |
DbEntityEntry<TEntity>.Collection Method (String)
Gets an object that represents the collection navigation property from this entity to a collection of related entities.
Parameters
- navigationProperty
-
Type:
System.String
The name of the navigation property.
Return Value
Type: System.Data.Entity.Infrastructure.DbCollectionEntryAn object representing the navigation property.
DbEntityEntry<TEntity>.Collection<TElement> Method (Expression<Func<TEntity, ICollection<TElement>>>)
Gets an object that represents the collection navigation property from this entity to a collection of related entities.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public DbCollectionEntry<TEntity, TElement> Collection<TElement>( Expression<Func<TEntity, ICollection<TElement>>> navigationProperty ) where TElement : class
Parameters
- navigationProperty
-
Type:
System.Linq.Expressions.Expression<Func<TEntity, ICollection<TElement>>>
An expression representing the navigation property.
Return Value
Type: System.Data.Entity.Infrastructure.DbCollectionEntry<TEntity, TElement>An object representing the navigation property.
Type Parameters
- TElement
The type of elements in the collection.
DbEntityEntry<TEntity>.Collection<TElement> Method (String)
Gets an object that represents the collection navigation property from this entity to a collection of related entities.
public DbCollectionEntry<TEntity, TElement> Collection<TElement>( string navigationProperty ) where TElement : class
Parameters
- navigationProperty
-
Type:
System.String
The name of the navigation property.
Return Value
Type: System.Data.Entity.Infrastructure.DbCollectionEntry<TEntity, TElement>An object representing the navigation property.
Type Parameters
- TElement
The type of elements in the collection.