I have the following scenario
(1)
The UI starts an edit session and each entity the user vists is tracked by a List(Of IEntity2) called EditBuffer.
(2) I inspect the EditBuffer list for dirty entities and collect them in another list
Dim toReturn As New List(Of IEntity2)()
'add any entities that were updated
For Each ent As IEntity2 In Me.EditBuffer
If ent.IsDirty Then
toReturn.Add(DirectCast(ent, IEntity2))
End If
Next
During debugging I found that the entity added to the toReturn list loses its Dirty flag (becomes FALSE) and the changed fields revert to their values before the change!!
Am I taking the wrong approach by casting to IEntity2 or its something else?