Table of Contents

Class EntityEntry<TEntity>

Namespace
Microsoft.EntityFrameworkCore.ChangeTracking
Assembly
Microsoft.EntityFrameworkCore.dll

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

public class EntityEntry<TEntity> : EntityEntry, IInfrastructure<InternalEntityEntry> where TEntity : class

Type Parameters

TEntity

The type of entity being tracked by this entry.

Inheritance
EntityEntry<TEntity>
Implements
Inherited Members
Extension Methods

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.

[EntityFrameworkInternal]
public EntityEntry(InternalEntityEntry internalEntry)

Parameters

internalEntry InternalEntityEntry

Properties

Entity

Gets the entity being tracked by this entry.

public virtual TEntity Entity { get; }

Property Value

TEntity

Methods

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.

public virtual CollectionEntry<TEntity, TProperty> Collection<TProperty>(INavigationBase navigation) where TProperty : class

Parameters

navigation INavigationBase

The collection navigation.

Returns

CollectionEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given navigation property.

Type Parameters

TProperty

Remarks

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.

public virtual CollectionEntry<TEntity, TProperty> Collection<TProperty>(Expression<Func<TEntity, IEnumerable<TProperty>>> propertyExpression) where TProperty : class

Parameters

propertyExpression Expression<Func<TEntity, IEnumerable<TProperty>>>

A lambda expression representing the collection navigation to access information and operations for.

Returns

CollectionEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given navigation property.

Type Parameters

TProperty

Remarks

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.

public virtual CollectionEntry<TEntity, TProperty> Collection<TProperty>(string propertyName) where TProperty : class

Parameters

propertyName string

The name of the navigation property.

Returns

CollectionEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given navigation property.

Type Parameters

TProperty

Remarks

ComplexProperty<TProperty>(IComplexProperty)

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

public virtual ComplexPropertyEntry<TEntity, TProperty> ComplexProperty<TProperty>(IComplexProperty complexProperty)

Parameters

complexProperty IComplexProperty

The property to access information and operations for.

Returns

ComplexPropertyEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given property.

Type Parameters

TProperty

The type of the property.

Remarks

See Accessing tracked entities in EF Core for more information and examples.

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

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

public virtual ComplexPropertyEntry<TEntity, TProperty> ComplexProperty<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression)

Parameters

propertyExpression Expression<Func<TEntity, TProperty>>

A lambda expression representing the property to access information and operations for.

Returns

ComplexPropertyEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given property.

Type Parameters

TProperty

Remarks

See Accessing tracked entities in EF Core for more information and examples.

ComplexProperty<TProperty>(string)

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

public virtual ComplexPropertyEntry<TEntity, TProperty> ComplexProperty<TProperty>(string propertyName)

Parameters

propertyName string

The property to access information and operations for.

Returns

ComplexPropertyEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given property.

Type Parameters

TProperty

The type of the property.

Remarks

See Accessing tracked entities in EF Core for more information and examples.

Property<TProperty>(IProperty)

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

public virtual PropertyEntry<TEntity, TProperty> Property<TProperty>(IProperty property)

Parameters

property IProperty

The property to access information and operations for.

Returns

PropertyEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given property.

Type Parameters

TProperty

The type of the property.

Remarks

See Accessing tracked entities in EF Core for more information and examples.

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

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

public virtual PropertyEntry<TEntity, TProperty> Property<TProperty>(Expression<Func<TEntity, TProperty>> propertyExpression)

Parameters

propertyExpression Expression<Func<TEntity, TProperty>>

A lambda expression representing the property to access information and operations for.

Returns

PropertyEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given property.

Type Parameters

TProperty

Remarks

See Accessing tracked entities in EF Core for more information and examples.

Property<TProperty>(string)

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

public virtual PropertyEntry<TEntity, TProperty> Property<TProperty>(string propertyName)

Parameters

propertyName string

The property to access information and operations for.

Returns

PropertyEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given property.

Type Parameters

TProperty

The type of the property.

Remarks

See Accessing tracked entities in EF Core for more information and examples.

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.

public virtual ReferenceEntry<TEntity, TProperty> Reference<TProperty>(INavigationBase navigation) where TProperty : class

Parameters

navigation INavigationBase

The reference navigation.

Returns

ReferenceEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given navigation property.

Type Parameters

TProperty

Remarks

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.

public virtual ReferenceEntry<TEntity, TProperty> Reference<TProperty>(Expression<Func<TEntity, TProperty?>> propertyExpression) where TProperty : class

Parameters

propertyExpression Expression<Func<TEntity, TProperty>>

A lambda expression representing the reference navigation to access information and operations for.

Returns

ReferenceEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given navigation property.

Type Parameters

TProperty

Remarks

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.

public virtual ReferenceEntry<TEntity, TProperty> Reference<TProperty>(string propertyName) where TProperty : class

Parameters

propertyName string

The name of the navigation property.

Returns

ReferenceEntry<TEntity, TProperty>

An object that exposes change tracking information and operations for the given navigation property.

Type Parameters

TProperty

Remarks