Old forum URL: forums.lhotka.net/forums/t/12151.aspx

appWPF posted on Friday, September 13, 2013

Hi Guys,

I am using WPF and I am new with CSLA. I need to know, it will seem a stupid question, but when is-it recommended to use the BeginEdit,CancelEdit and ApplyEdit? If I need only one level of Undo, do you recommend me to reload the data when the user press the cancel button, or to use the Root.CancelEdit()?

JonnyBee replied on Sunday, September 15, 2013

You use these methods to achieve N-level Undo. 

If you do not need N-level undo then easiest solution is to discard the object and load a new object from the database.
It´s all up to you.  

The main reason to use N-level undo is to avoid "unnecessary" database access and keep a responsive UI.  

Copyright (c) Marimer LLC