Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
EntityEntry<TEntity>.Collection Method
Definition
- Namespace:
- Microsoft.EntityFrameworkCore.ChangeTracking
- Assembly:
- Microsoft.EntityFrameworkCore.dll
- Package:
- Microsoft.EntityFrameworkCore v10.0.0
- Package:
- Microsoft.EntityFrameworkCore v7.0.0
- Package:
- Microsoft.EntityFrameworkCore v8.0.0
- Package:
- Microsoft.EntityFrameworkCore v9.0.0
- Package:
- Microsoft.EntityFrameworkCore v1.1.6
- Package:
- Microsoft.EntityFrameworkCore v2.0.3
- Package:
- Microsoft.EntityFrameworkCore v2.1.11
- Package:
- Microsoft.EntityFrameworkCore v2.2.6
- Package:
- Microsoft.EntityFrameworkCore v3.0.0
- Package:
- Microsoft.EntityFrameworkCore v3.1.0
- Package:
- Microsoft.EntityFrameworkCore v5.0.0
- Package:
- Microsoft.EntityFrameworkCore v6.0.0
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Collection<TProperty>(INavigationBase) |
Provides access to change tracking and loading information for a collection navigation property that associates this entity to a collection of another entities. |
| Collection<TProperty>(Expression<Func<TEntity,IEnumerable<TProperty>>>) |
Provides access to change tracking and loading information for a collection navigation property that associates this entity to a collection of another entities. |
| Collection<TProperty>(String) |
Provides access to change tracking and loading information for a collection navigation property that associates this entity to a collection of another entities. |
Collection<TProperty>(INavigationBase)
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
Provides access to change tracking and loading information for a collection navigation property that associates this entity to a collection of another entities.
public virtual Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<TEntity,TProperty> Collection<TProperty>(Microsoft.EntityFrameworkCore.Metadata.INavigationBase navigation) where TProperty : class;
override this.Collection : Microsoft.EntityFrameworkCore.Metadata.INavigationBase -> Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<'Entity, 'Property (requires 'Entity : null and 'Property : null)> (requires 'Property : null)
Public Overridable Function Collection(Of TProperty As Class) (navigation As INavigationBase) As CollectionEntry(Of TEntity, TProperty)
Type Parameters
- TProperty
Parameters
- navigation
- INavigationBase
The collection navigation.
Returns
An object that exposes change tracking information and operations for the given navigation property.
Remarks
See Accessing tracked entities in EF Core and Changing foreign keys and navigations for more information and examples.
Applies to
Collection<TProperty>(Expression<Func<TEntity,IEnumerable<TProperty>>>)
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
Provides access to change tracking and loading information for a collection navigation property that associates this entity to a collection of another entities.
public virtual Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<TEntity,TProperty> Collection<TProperty>(System.Linq.Expressions.Expression<Func<TEntity,System.Collections.Generic.IEnumerable<TProperty>>> propertyExpression) where TProperty : class;
override this.Collection : System.Linq.Expressions.Expression<Func<'Entity, seq<'Property>>> -> Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<'Entity, 'Property (requires 'Entity : null and 'Property : null)> (requires 'Property : null)
Public Overridable Function Collection(Of TProperty As Class) (propertyExpression As Expression(Of Func(Of TEntity, IEnumerable(Of TProperty)))) As CollectionEntry(Of TEntity, TProperty)
Type Parameters
- TProperty
Parameters
- propertyExpression
- Expression<Func<TEntity,IEnumerable<TProperty>>>
A lambda expression representing the collection navigation to access information and operations for.
Returns
An object that exposes change tracking information and operations for the given navigation property.
Remarks
See Accessing tracked entities in EF Core and Changing foreign keys and navigations for more information and examples.
Applies to
Collection<TProperty>(String)
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
- Source:
- EntityEntry%60.cs
Provides access to change tracking and loading information for a collection navigation property that associates this entity to a collection of another entities.
public virtual Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<TEntity,TProperty> Collection<TProperty>(string propertyName) where TProperty : class;
override this.Collection : string -> Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<'Entity, 'Property (requires 'Entity : null and 'Property : null)> (requires 'Property : null)
Public Overridable Function Collection(Of TProperty As Class) (propertyName As String) As CollectionEntry(Of TEntity, TProperty)
Type Parameters
- TProperty
Parameters
- propertyName
- String
The name of the navigation property.
Returns
An object that exposes change tracking information and operations for the given navigation property.
Remarks
See Accessing tracked entities in EF Core and Changing foreign keys and navigations for more information and examples.
Applies to
Entity Framework
Feedback
Was this page helpful?
