DbEntityEntry<TEntity> DbEntityEntry<TEntity> DbEntityEntry<TEntity> Class

Definition

Instances of this class provide access to information about and control of entities that are being tracked by the DbContext. Use the Entity or Entities methods of the context to obtain objects of this type.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification="FxCop rule is wrong; Database is not two words.", MessageId="Db")]
public class DbEntityEntry<TEntity> where TEntity : class
type DbEntityEntry<'Entity (requires 'Entity : null)> = class
Public Class DbEntityEntry(Of TEntity)

Type Parameters

TEntity

The type of the entity.

Inheritance
DbEntityEntry<TEntity>DbEntityEntry<TEntity>DbEntityEntry<TEntity>
Attributes

Properties

CurrentValues CurrentValues CurrentValues

Gets the current property values for the tracked entity represented by this object.

Entity Entity Entity

Gets the entity.

OriginalValues OriginalValues OriginalValues

Gets the original property values for the tracked entity represented by this object. The original values are usually the entity's property values as they were when last queried from the database.

State State State

Gets or sets the state of the entity.

Methods

Collection(String) Collection(String) Collection(String)

Gets an object that represents the collection navigation property from this entity to a collection of related entities.

Collection<TElement>(Expression<Func<TEntity,ICollection<TElement>>>) Collection<TElement>(Expression<Func<TEntity,ICollection<TElement>>>) Collection<TElement>(Expression<Func<TEntity,ICollection<TElement>>>)

Gets an object that represents the collection navigation property from this entity to a collection of related entities.

Collection<TElement>(String) Collection<TElement>(String) Collection<TElement>(String)

Gets an object that represents the collection navigation property from this entity to a collection of related entities.

ComplexProperty(String) ComplexProperty(String) ComplexProperty(String)

Gets an object that represents a complex property of this entity.

ComplexProperty<TComplexProperty>(Expression<Func<TEntity,TComplexProperty>>) ComplexProperty<TComplexProperty>(Expression<Func<TEntity,TComplexProperty>>) ComplexProperty<TComplexProperty>(Expression<Func<TEntity,TComplexProperty>>)

Gets an object that represents a complex property of this entity.

ComplexProperty<TComplexProperty>(String) ComplexProperty<TComplexProperty>(String) ComplexProperty<TComplexProperty>(String)

Gets an object that represents a complex property of this entity.

Equals(DbEntityEntry<TEntity>) Equals(DbEntityEntry<TEntity>) Equals(DbEntityEntry<TEntity>)

Determines whether the specified DbEntityEntry<TEntity> is equal to this instance. Two DbEntityEntry<TEntity> instances are considered equal if they are both entries for the same entity on the same DbContext.

Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified Object is equal to this instance. Two DbEntityEntry<TEntity> instances are considered equal if they are both entries for the same entity on the same DbContext.

GetDatabaseValues() GetDatabaseValues() GetDatabaseValues()

Queries the database for copies of the values of the tracked entity as they currently exist in the database. Note that changing the values in the returned dictionary will not update the values in the database. If the entity is not found in the database then null is returned.

GetDatabaseValuesAsync() GetDatabaseValuesAsync() GetDatabaseValuesAsync()

Asynchronously queries the database for copies of the values of the tracked entity as they currently exist in the database. Note that changing the values in the returned dictionary will not update the values in the database. If the entity is not found in the database then null is returned.

GetDatabaseValuesAsync(CancellationToken) GetDatabaseValuesAsync(CancellationToken) GetDatabaseValuesAsync(CancellationToken)

Asynchronously queries the database for copies of the values of the tracked entity as they currently exist in the database. Note that changing the values in the returned dictionary will not update the values in the database. If the entity is not found in the database then null is returned.

GetHashCode() GetHashCode() GetHashCode()

Returns a hash code for this instance.

GetType() GetType() GetType()

Gets the Type of the current instance.

GetValidationResult() GetValidationResult() GetValidationResult()

Validates this DbEntityEntry<TEntity> instance and returns validation result.

Member(String) Member(String) Member(String)

Gets an object that represents a member of the entity. The runtime type of the returned object will vary depending on what kind of member is asked for. The currently supported member types and their return types are: Reference navigation property: DbReferenceEntry. Collection navigation property: DbCollectionEntry. Primitive/scalar property: DbPropertyEntry. Complex property: DbComplexPropertyEntry.

Member<TMember>(String) Member<TMember>(String) Member<TMember>(String)

Gets an object that represents a member of the entity. The runtime type of the returned object will vary depending on what kind of member is asked for. The currently supported member types and their return types are: Reference navigation property: DbReferenceEntry<TEntity,TProperty>. Collection navigation property: DbCollectionEntry<TEntity,TElement>. Primitive/scalar property: DbPropertyEntry<TEntity,TProperty>. Complex property: DbComplexPropertyEntry<TEntity,TComplexProperty>.

Property(String) Property(String) Property(String)

Gets an object that represents a scalar or complex property of this entity.

Property<TProperty>(Expression<Func<TEntity,TProperty>>) Property<TProperty>(Expression<Func<TEntity,TProperty>>) Property<TProperty>(Expression<Func<TEntity,TProperty>>)

Gets an object that represents a scalar or complex property of this entity.

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

Gets an object that represents a scalar or complex property of this entity.

Reference(String) Reference(String) Reference(String)

Gets an object that represents the reference (i.e. non-collection) navigation property from this entity to another entity.

Reference<TProperty>(Expression<Func<TEntity,TProperty>>) Reference<TProperty>(Expression<Func<TEntity,TProperty>>) Reference<TProperty>(Expression<Func<TEntity,TProperty>>)

Gets an object that represents the reference (i.e. non-collection) navigation property from this entity to another entity.

Reference<TProperty>(String) Reference<TProperty>(String) Reference<TProperty>(String)

Gets an object that represents the reference (i.e. non-collection) navigation property from this entity to another entity.

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

ReloadAsync() ReloadAsync() ReloadAsync()

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

ReloadAsync(CancellationToken) ReloadAsync(CancellationToken) ReloadAsync(CancellationToken)

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

ToString() ToString() ToString()

Operators

Implicit(DbEntityEntry<TEntity> to DbEntityEntry) Implicit(DbEntityEntry<TEntity> to DbEntityEntry) Implicit(DbEntityEntry<TEntity> to DbEntityEntry)

Returns a new instance of the non-generic DbEntityEntry class for the tracked entity represented by this object.

Applies to