EntityEntry<TEntity> EntityEntry(Of TEntity) Class

Definition

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

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.

public class EntityEntry<TEntity> : EntityEntry, IInfrastructure<InternalEntityEntry> where TEntity : class
Public Class EntityEntry(Of TEntity As Class)
    Inherits EntityEntry
    Implements IInfrastructure(Of InternalEntityEntry)

Type Parameters

TEntity

The type of entity being tracked by this entry.

Inheritance
System.ObjectSystem.Object
EntityEntry<TEntity>EntityEntry(Of TEntity)
Implements

Constructors

EntityEntry(InternalEntityEntry) EntityEntry(InternalEntityEntry)

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.

Properties

Collections Collections

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

(Inherited from EntityEntry)
Context Context

Gets the context that is tracking the entity.

(Inherited from EntityEntry)
CurrentValues CurrentValues

Gets the current property values for this entity.

(Inherited from EntityEntry)
Entity Entity

Gets the entity being tracked by this entry.

IInfrastructure<InternalEntityEntry>.Instance Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry>.Instance

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

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

Gets a value indicating if the key values of this entity have been assigned a value. False if one or more of the key properties is assigned null or the CLR default, otherwise true.

(Inherited from EntityEntry)
Members Members

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

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

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

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

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

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

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

When setting the state, the entity will always end up in the specified state. For example, if you change the state to Deleted the entity will be marked for deletion regardless of its current state. This is different than calling Remove(TEntity) where the entity will be disconnected (rather than marked for deletion) if it is in the Added state.

(Inherited from EntityEntry)

Methods

Collection(String) Collection(String)

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

(Inherited from EntityEntry)
Collection<TProperty>(Expression<Func<TEntity, IEnumerable<TProperty>>>) Collection(Of TProperty)(Expression(Of Func(Of TEntity, IEnumerable(Of 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) Collection(Of 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.

System.Object.Equals(System.Object) System.Object.Equals(System.Object) Inherited from System.Object
System.Object.Equals(System.Object, System.Object) System.Object.Equals(System.Object, System.Object) Inherited from System.Object
GetDatabaseValues() 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.

Note that changing the values in the returned dictionary will not update the values in the database.

(Inherited from EntityEntry)
GetDatabaseValuesAsync(CancellationToken) 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.

Note that changing the values in the returned dictionary will not update the values in the database.

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

(Inherited from EntityEntry)
System.Object.GetHashCode() System.Object.GetHashCode() Inherited from System.Object
System.Object.GetType() System.Object.GetType() Inherited from System.Object
Member(String) Member(String)

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

(Inherited from EntityEntry)
System.Object.MemberwiseClone() System.Object.MemberwiseClone() Inherited from System.Object
Navigation(String) Navigation(String)

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

(Inherited from EntityEntry)
Property(String) 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>>) Property(Of TProperty)(Expression(Of Func(Of TEntity, TProperty)))

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

Property<TProperty>(String) Property(Of TProperty)(String)

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

Reference(String) Reference(String)

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

(Inherited from EntityEntry)
Reference<TProperty>(Expression<Func<TEntity, TProperty>>) Reference(Of TProperty)(Expression(Of Func(Of 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>(String) Reference(Of TProperty)(String)

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

System.Object.ReferenceEquals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) Inherited from System.Object
Reload() Reload()

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

The entity will be in the Unchanged state after calling this method, unless the entity does not exist in the database, in which case the entity will be Detached. Finally, calling Reload on an Added entity that does not exist in the database is a no-op. Note, however, that an Added entity may not yet have had its permanent key value created.

(Inherited from EntityEntry)
ReloadAsync(CancellationToken) ReloadAsync(CancellationToken)

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

The entity will be in the Unchanged state after calling this method, unless the entity does not exist in the database, in which case the entity will be Detached. Finally, calling Reload on an Added entity that does not exist in the database is a no-op. Note, however, that an Added entity may not yet have had its permanent key value created.

(Inherited from EntityEntry)
System.Object.ToString() System.Object.ToString() Inherited from System.Object

Extension Methods

Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetInfrastructure<Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry>() Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetInfrastructure(Of Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry)()