CollectionEntry<TEntity,TRelatedEntity> Class

Definition

Provides access to change tracking and loading information for a collection navigation property that associates this entity to a collection of another entities.

public class CollectionEntry<TEntity,TProperty> : Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry where TEntity : class where TProperty : class
public class CollectionEntry<TEntity,TRelatedEntity> : Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry where TEntity : class where TRelatedEntity : class
type CollectionEntry<'Entity, 'Property (requires 'Entity : null and 'Property : null)> = class
    inherit CollectionEntry
type CollectionEntry<'Entity, 'RelatedEntity (requires 'Entity : null and 'RelatedEntity : null)> = class
    inherit CollectionEntry
Public Class CollectionEntry(Of TEntity, TProperty)
Inherits CollectionEntry
Public Class CollectionEntry(Of TEntity, TRelatedEntity)
Inherits CollectionEntry

Type Parameters

TEntity

The type of the entity the property belongs to.

TProperty TRelatedEntity

The type of the property.

Inheritance
CollectionEntry<TEntity,TRelatedEntity>

Remarks

Instances of this class are returned from methods when using the ChangeTracker API and it is not designed to be directly constructed in your application code.

See Accessing tracked entities in EF Core, Changing foreign keys and navigations, and Loading related entities for more information and examples.

Constructors

CollectionEntry<TEntity,TRelatedEntity>(InternalEntityEntry, INavigation)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

CollectionEntry<TEntity,TRelatedEntity>(InternalEntityEntry, INavigationBase)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

CollectionEntry<TEntity,TRelatedEntity>(InternalEntityEntry, String)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Properties

CurrentValue

Gets or sets the value currently assigned to this property. If the current value is set using this property, the change tracker is aware of the change and DetectChanges() is not required for the context to detect the change.

EntityEntry

The EntityEntry<TEntity> to which this member belongs.

InternalEntry

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from MemberEntry)
IsLoaded

Gets or sets a value indicating whether the entity or entities referenced by this navigation property are known to be loaded.

(Inherited from NavigationEntry)
IsModified

Gets or sets a value indicating whether any of foreign key property values associated with this navigation property have been modified and should be updated in the database when SaveChanges() is called.

(Inherited from CollectionEntry)
Metadata

Gets the metadata that describes the facets of this property and how it maps to the database.

(Inherited from NavigationEntry)

Methods

EnsureInitialized()

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.

(Inherited from CollectionEntry)
FindEntry(Object)

The EntityEntry<TEntity> of an entity this navigation targets.

FindEntry(Object)

The EntityEntry of an entity this navigation targets.

(Inherited from CollectionEntry)
Finder(Type)

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.

(Inherited from NavigationEntry)
GetInternalTargetEntry(Object)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from CollectionEntry)
Load()

Loads the entities referenced by this navigation property, unless IsLoaded is already set to true.

(Inherited from CollectionEntry)
Load(LoadOptions)

Loads the entities referenced by this navigation property, unless IsLoaded is already set to true.

(Inherited from CollectionEntry)
LoadAsync(CancellationToken)

Loads entities referenced by this navigation property, unless IsLoaded is already set to true.

(Inherited from CollectionEntry)
LoadAsync(LoadOptions, CancellationToken)

Loads entities referenced by this navigation property, unless IsLoaded is already set to true.

(Inherited from CollectionEntry)
Query()

Returns the query that would be used by Load() to load entities referenced by this navigation property.

Explicit Interface Implementations

IInfrastructure<InternalEntityEntry>.Instance

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from MemberEntry)

Extension Methods

GetInfrastructure<T>(IInfrastructure<T>)

Gets the value from a property that is being hidden using IInfrastructure<T>.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

Applies to