Interface IUpdateEntry
- Namespace
- Microsoft.EntityFrameworkCore.Update
- Assembly
- Microsoft.EntityFrameworkCore.dll
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
- Extension Methods
Remarks
See Implementation of database providers and extensions for more information and examples.
Properties
Context
The current DbContext being used.
DbContext Context { get; }
Property Value
EntityState
The state of the entity to be saved.
EntityState EntityState { get; set; }
Property Value
EntityType
The type of entity to be saved to the database.
IEntityType EntityType { get; }
Property Value
SharedIdentityEntry
The other entry that has the same key values, if one exists.
IUpdateEntry? SharedIdentityEntry { get; }
Property Value
Methods
GetCurrentValue(IPropertyBase)
Gets the value assigned to the property.
object? GetCurrentValue(IPropertyBase propertyBase)
Parameters
propertyBase
IPropertyBaseThe property to get the value for.
Returns
- object
The value for the property.
GetCurrentValue<TProperty>(IPropertyBase)
Gets the value assigned to the property.
TProperty GetCurrentValue<TProperty>(IPropertyBase propertyBase)
Parameters
propertyBase
IPropertyBaseThe property to get the value for.
Returns
- TProperty
The value for the property.
Type Parameters
TProperty
The type of the property.
GetOriginalValue(IPropertyBase)
Gets the value assigned to the property when it was retrieved from the database.
object? GetOriginalValue(IPropertyBase propertyBase)
Parameters
propertyBase
IPropertyBaseThe property to get the value for.
Returns
- object
The value for the property.
GetOriginalValue<TProperty>(IProperty)
Gets the value assigned to the property when it was retrieved from the database.
TProperty GetOriginalValue<TProperty>(IProperty property)
Parameters
property
IPropertyThe property to get the value for.
Returns
- TProperty
The value for the property.
Type Parameters
TProperty
The type of the property.
GetPreStoreGeneratedCurrentValue(IPropertyBase)
Gets the value assigned to the property before any store-generated values have been applied.
object? GetPreStoreGeneratedCurrentValue(IPropertyBase propertyBase)
Parameters
propertyBase
IPropertyBaseThe property to get the value for.
Returns
- object
The value for the property.
GetRelationshipSnapshotValue(IPropertyBase)
Gets the last value assigned to the property that's part of a foreign key or principal key
object? GetRelationshipSnapshotValue(IPropertyBase propertyBase)
Parameters
propertyBase
IPropertyBaseThe property to get the value for.
Returns
- object
The value for the property.
HasTemporaryValue(IProperty)
Gets a value indicating if the specified property has a temporary value.
bool HasTemporaryValue(IProperty property)
Parameters
property
IPropertyThe property to be checked.
Returns
IsConceptualNull(IProperty)
Checks whether the property is conceptually set to null even if the property type is not nullable.
bool IsConceptualNull(IProperty property)
Parameters
property
IPropertyThe property to check.
Returns
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.
bool IsModified(IProperty property)
Parameters
property
IPropertyThe property to be checked.
Returns
IsStoreGenerated(IProperty)
Gets a value indicating if the specified property should have a value generated by the database.
bool IsStoreGenerated(IProperty property)
Parameters
property
IPropertyThe property to be checked.
Returns
SetOriginalValue(IProperty, object?)
Sets the original value of the given property.
void SetOriginalValue(IProperty property, object? value)
Parameters
SetPropertyModified(IProperty)
Marks the given property as modified.
void SetPropertyModified(IProperty property)
Parameters
property
IPropertyThe property to mark as modified.
SetStoreGeneratedValue(IProperty, object?, bool)
Assign a store-generated value to the property.
void SetStoreGeneratedValue(IProperty property, object? value, bool setModified = true)
Parameters
property
IPropertyThe property to set the value for.
value
objectThe value to set.
setModified
boolWhether to set the store-generated property's state to Modified.
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.
EntityEntry ToEntityEntry()
Returns
- EntityEntry
An EntityEntry for this entity.