EntityEntry<TEntity> Class

Definition

Provides access to change tracking information and operations for a given entity.

public class EntityEntry<TEntity> : Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry where TEntity : class
type EntityEntry<'Entity (requires 'Entity : null)> = class
    inherit EntityEntry
Public Class EntityEntry(Of TEntity)
Inherits EntityEntry

Type Parameters

TEntity

The type of entity being tracked by this entry.

Inheritance
EntityEntry<TEntity>

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 for more information and examples.

Constructors

EntityEntry<TEntity>(InternalEntityEntry)

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

Collections

Provides access to change tracking information and loading information for all collection navigation properties of this entity.

(Inherited from EntityEntry)
ComplexProperties

Provides access to change tracking information and operations for all properties of complex type on this entity.

(Inherited from EntityEntry)
Context

Gets the context that is tracking the entity.

(Inherited from EntityEntry)
CurrentValues

Gets the current property values for this entity.

(Inherited from EntityEntry)
DebugView

Expand this property in the debugger for a human-readable view of entry.

Warning: Do not rely on the format of the debug strings. They are designed for debugging only and may change arbitrarily between releases.

(Inherited from EntityEntry)
Entity

Gets the entity being tracked by this entry.

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 EntityEntry)
IsKeySet

Gets a value indicating if the key values of this entity have been assigned a value.

(Inherited from EntityEntry)
Members

Provides access to change tracking information and operations for all properties and navigations of this entity.

(Inherited from EntityEntry)
Metadata

Gets the metadata about the shape of the entity, its relationships to other entities, and how it maps to the database.

(Inherited from EntityEntry)
Navigations

Provides access to change tracking information and operations for all navigation properties of this entity.

(Inherited from EntityEntry)
OriginalValues

Gets the original property values for this entity. The original values are the property values as they were when the entity was retrieved from the database.

(Inherited from EntityEntry)
Properties

Provides access to change tracking information and operations for all properties of this entity.

(Inherited from EntityEntry)
References

Provides access to change tracking information and loading information for all reference (i.e. non-collection) navigation properties of this entity.

(Inherited from EntityEntry)
State

Gets or sets that state that this entity is being tracked in.

(Inherited from EntityEntry)

Methods

Collection(INavigationBase)

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

(Inherited from EntityEntry)
Collection(String)

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

(Inherited from EntityEntry)
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>(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>(String)

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

ComplexProperty(IComplexProperty)

Provides access to change tracking information and operations for a given property of a complex type on this entity.

(Inherited from EntityEntry)
ComplexProperty(String)

Provides access to change tracking information and operations for a given property of a complex type on this entity.

(Inherited from EntityEntry)
ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>)

Provides access to change tracking information and operations for a given complex type property of this entity.

ComplexProperty<TProperty>(IComplexProperty)

Provides access to change tracking information and operations for a given complex type property of this entity.

ComplexProperty<TProperty>(String)

Provides access to change tracking information and operations for a given complex type property of this entity.

DetectChanges()

Scans this entity instance to detect any changes made to the instance data. DetectChanges() is usually called automatically by the context to get up-to-date information on an individual entity before returning change tracking information. You typically only need to call this method if you have disabled AutoDetectChangesEnabled.

(Inherited from EntityEntry)
GetDatabaseValues()

Queries the database for copies of the values of the tracked entity as they currently exist in the database. If the entity is not found in the database, then null is returned.

(Inherited from EntityEntry)
GetDatabaseValuesAsync(CancellationToken)

Queries the database for copies of the values of the tracked entity as they currently exist in the database. If the entity is not found in the database, then null is returned.

(Inherited from EntityEntry)
Member(IPropertyBase)

Provides access to change tracking information and operations for a given property or navigation of this entity.

(Inherited from EntityEntry)
Member(String)

Provides access to change tracking information and operations for a given property or navigation of this entity.

(Inherited from EntityEntry)
Navigation(INavigationBase)

Provides access to change tracking information and operations for a given navigation of this entity.

(Inherited from EntityEntry)
Navigation(String)

Provides access to change tracking information and operations for a given navigation of this entity.

(Inherited from EntityEntry)
Property(IProperty)

Provides access to change tracking information and operations for a given property of this entity.

(Inherited from EntityEntry)
Property(String)

Provides access to change tracking information and operations for a given property of this entity.

(Inherited from EntityEntry)
Property<TProperty>(Expression<Func<TEntity,TProperty>>)

Provides access to change tracking information and operations for a given property of this entity.

Property<TProperty>(IProperty)

Provides access to change tracking information and operations for a given property of this entity.

Property<TProperty>(String)

Provides access to change tracking information and operations for a given property of this entity.

Reference(INavigationBase)

Provides access to change tracking and loading information for a reference (i.e. non-collection) navigation that associates this entity to another entity.

(Inherited from EntityEntry)
Reference(String)

Provides access to change tracking and loading information for a reference (i.e. non-collection) navigation that associates this entity to another entity.

(Inherited from EntityEntry)
Reference<TProperty>(Expression<Func<TEntity,TProperty>>)

Provides access to change tracking and loading information for a reference (i.e. non-collection) navigation property that associates this entity to another entity.

Reference<TProperty>(INavigationBase)

Provides access to change tracking and loading information for a reference (i.e. non-collection) navigation that associates this entity to another entity.

Reference<TProperty>(String)

Provides access to change tracking and loading information for a reference (i.e. non-collection) navigation that associates this entity to another entity.

Reload()

Reloads the entity from the database overwriting any property values with values from the database.

(Inherited from EntityEntry)
ReloadAsync(CancellationToken)

Reloads the entity from the database overwriting any property values with values from the database.

(Inherited from EntityEntry)

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 EntityEntry)

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