Udostępnij za pośrednictwem


IUpdateEntry Interface

Definition

The information passed to a database provider to save changes to an entity to the database.

This interface is typically used by database providers (and other extensions). It is generally not used in application code.

public interface IUpdateEntry
type IUpdateEntry = interface
Public Interface IUpdateEntry

Remarks

See Implementation of database providers and extensions for more information and examples.

Properties

Context

The current DbContext being used.

EntityState

The state of the entity to be saved.

EntityType

The type of entity to be saved to the database.

SharedIdentityEntry

The other entry that has the same key values, if one exists.

Methods

CanHaveOriginalValue(IPropertyBase)

Returns true only if the property has storage for an original value.

GetCurrentValue(IPropertyBase)

Gets the value assigned to the property.

GetCurrentValue<TProperty>(IPropertyBase)

Gets the value assigned to the property.

GetOriginalValue(IPropertyBase)

Gets the value assigned to the property when it was retrieved from the database.

GetOriginalValue<TProperty>(IProperty)

Gets the value assigned to the property when it was retrieved from the database.

GetPreStoreGeneratedCurrentValue(IPropertyBase)

Gets the value assigned to the property before any store-generated values have been applied.

GetRelationshipSnapshotValue(IPropertyBase)

Gets the last value assigned to the property that's part of a foreign key or principal key

HasExplicitValue(IProperty)

Gets a value indicating if the specified property has an explicit value set.

HasStoreGeneratedValue(IProperty)

Gets a value indicating if the specified property has a store-generated value that has not yet been saved to the entity.

HasTemporaryValue(IProperty)

Gets a value indicating if the specified property has a temporary value.

IsConceptualNull(IProperty)

Checks whether the property is conceptually set to null even if the property type is not nullable.

IsModified(IProperty)

Gets a value indicating if the specified property is modified. If true, the current value assigned to the property should be saved to the database.

IsStoreGenerated(IProperty)

Gets a value indicating if the specified property should have a value generated by the database.

SetCurrentValue(IPropertyBase, Object)

Assign the given value to the property.

SetOriginalValue(IProperty, Object)

Sets the original value of the given property.

SetPropertyModified(IProperty)

Marks the given property as modified.

SetStoreGeneratedValue(IProperty, Object, Boolean)

Assign a store-generated value to the property.

SetStoreGeneratedValue(IProperty, Object)

Assign a store-generated value to the property.

ToEntityEntry()

Gets an EntityEntry for the entity being saved. EntityEntry is an API optimized for application developers and IUpdateEntry is optimized for database providers, but there may be instances where a database provider wants to access information from EntityEntry.

Extension Methods

BuildCurrentValuesString(IUpdateEntry, IEnumerable<IPropertyBase>)

Creates a formatted string representation of the given properties and their current values such as is useful when throwing exceptions about keys, indexes, etc. that use the properties.

BuildOriginalValuesString(IUpdateEntry, IEnumerable<IPropertyBase>)

Creates a formatted string representation of the given properties and their original values such as is useful when throwing exceptions about keys, indexes, etc. that use the properties.

GetCurrentProviderValue(IUpdateEntry, IProperty)

Gets the value assigned to the property and converts it to the provider-expected value.

GetOriginalProviderValue(IUpdateEntry, IProperty)

Gets the original value that was assigned to the property and converts it to the provider-expected value.

ToDebugString(IUpdateEntry, ChangeTrackerDebugStringOptions, Int32)

Creates a human-readable representation of the given IUpdateEntry.

Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.

Applies to