Delen via


EntityEntry Class

Definition

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

[System.Diagnostics.DebuggerDisplay("{_internalEntityEntry,nq}")]
public class EntityEntry : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry>
[System.Diagnostics.DebuggerDisplay("{InternalEntry,nq}")]
public class EntityEntry : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry>
[<System.Diagnostics.DebuggerDisplay("{_internalEntityEntry,nq}")>]
type EntityEntry = class
    interface IInfrastructure<InternalEntityEntry>
[<System.Diagnostics.DebuggerDisplay("{InternalEntry,nq}")>]
type EntityEntry = class
    interface IInfrastructure<InternalEntityEntry>
Public Class EntityEntry
Implements IInfrastructure(Of InternalEntityEntry)
Inheritance
EntityEntry
Derived
Attributes
Implements
IInfrastructure<Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry>

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(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.

ComplexProperties

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

Context

Gets the context that is tracking the entity.

CurrentValues

Gets the current property values for this entity.

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.

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.

IsKeySet

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

Members

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

Metadata

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

Navigations

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

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.

Properties

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

References

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

State

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

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.

Collection(String)

Provides access to change tracking and loading information for a collection navigation 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.

ComplexProperty(String)

Provides access to change tracking information and operations for a given property of a complex type on 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.

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.

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.

Member(IPropertyBase)

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

Member(String)

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

Navigation(INavigationBase)

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

Navigation(String)

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

Property(IProperty)

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

Property(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.

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.

Reload()

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

ReloadAsync(CancellationToken)

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

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.

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