I know that calling TMappedEntity.Cancel will cancel any modifications. But I believe it will simply cancel all modifications. What if I have several stages in editing my entities? And in each stage I need to be able to undo to prior stage's state?
Thanks!
How to Accommodate Multiple Undos?
Re: How to Accommodate Multiple Undos?
Hello,
The Cancel method cancels all changes applied to an instance before calling the Save or SubmitChanges methods. After calling these methods, cancel is unavailable, since changes are saved in the database. Please describe the needed functionality in more details (several stages in editing my entities) - and we will try to help you solve the issue.
The Cancel method cancels all changes applied to an instance before calling the Save or SubmitChanges methods. After calling these methods, cancel is unavailable, since changes are saved in the database. Please describe the needed functionality in more details (several stages in editing my entities) - and we will try to help you solve the issue.
Re: How to Accommodate Multiple Undos?
Hi Alex,
Thank you very much for the reply. In the current project (which is the first time I am using EntityDAC) I haven't encountered the need to go multiple stages upon editing an object. However I have met such requirements before in my previous projects. So this question is to anticipate when such requirement arises.
In my previous projects, I solved this requirement my creating a copy/clone of the original object/entity for each stage. I don't know how to implement this in EntityDAC since the entities need to be attached to an entityContext to work properly (especially when the entities containing TCollectionData properties).
Can you point me to easy way to create temporary copies of an entity?
Thank you very much for the reply. In the current project (which is the first time I am using EntityDAC) I haven't encountered the need to go multiple stages upon editing an object. However I have met such requirements before in my previous projects. So this question is to anticipate when such requirement arises.
In my previous projects, I solved this requirement my creating a copy/clone of the original object/entity for each stage. I don't know how to implement this in EntityDAC since the entities need to be attached to an entityContext to work properly (especially when the entities containing TCollectionData properties).
Can you point me to easy way to create temporary copies of an entity?
Re: How to Accommodate Multiple Undos?
There is no capability to copy/clone objects for the time being. Please send a small sample or a code abstract demonstrating step-by-step editing - we will try to find a solution with no need to copy objects.