In the olden days of the DataSet
(and related objects), the in-memory representations of the data objects--DataRow
and DataRowView
--supported transactional edits through BeginEdit
, EndEdit
, and CancelEdit
. Having both in place allowed more than simply being able to "undo" changes made to an object and reverting it back to its retrieved (or uninitialized) values; the DataRowView
object allowed a developer to begin a single editing operation on a DataRow
in any state and undo those changes without undoing other changes that might have been made.
For example,
DataRow
retrieved as:
Col1 | Col2
----------------
1 2
DataRow
Modified to:
Col1 | Col2
----------------
1 3
BeginEdit
called on a DataRowView
object for this row.
DataRowView
modified to:
Col1 | Col2
----------------
2 3
CancelEdit
called on the DataRowView
, reverting the values to
Col1 | Col2
----------------
1 3
So the change was undone, but the values present before the edit--even though they were in-memory changes and not the retrieved values--are preserved.
Is there any similar facility in the Entity Framework? I have a sneaking suspicion that the answer is "no", considering that it looks like an Entity
uses simple backing variables for column values rather than a "property bag" approach like the DataRow
uses (or WPF's DependencyProperty
infrastructure uses).