About Applycurrentvalues and applyoriginalvalues differences in EF: Both are used when editing data.
//
Summary:
Will System.Data.Objects.ObjectStateEntry's System.Data.Objects.ObjectStateEntry.CurrentValues
property is set to match the property value of the provided object.
//
Parameters:
Currententity:
The detached object that has the property update to apply to the original object.
//
return Result:
The object that was updated.
Public TEntity applycurrentvalues (TEntity currententity)
There are two ways to take the value of parameter currententity
(1) Identify the object from memory, edit the field you want to edit, and then pass in.
(2) A new object created with the newly keyword, note that the created object must satisfy the data table constraint and then pass in.
//
Summary:
Will System.Data.Objects.ObjectStateEntry's System.Data.Objects.ObjectStateEntry.OriginalValues
property is set to match the property value of the provided object.
//
Parameters:
Originalentity:
The detached object that has the property update to apply to the original object.
//
return Result:
The object that was updated.
Public TEntity applyoriginalvalues (TEntity originalentity);
There is only one way to take the value of parameter originalentity
(1) The objects that are isolated from memory, edit the fields you need to edit, and then pass in.