I haven't looked at the sample code lately, but in our application the object is marked "old" after the delete is committed to the database. A second call to Save() would have no effect since the object does not appear dirty. If you did change a field and make the deleted object dirty, the database update would fail (similar to a concurrency violation) because the record no longer exists in the database.
However, this is because I implemented the save functionality myself and this is what I chose to do. CSLA is fairly agnostic as to what happens during object saving, so to some degree it is can be up to you to implement your own behavior in this case.
You should be able to find this out by:
1. Running the code and stepping in to CSLA to see what it does.
2. Reading the book. (You did buy a copy, right?) You can get the 2008 book (a preview edition is available as .pdf if you pre-order it.)
As I recall the DataPortal marks your BO as New once the delete occurs because the data is no longer in the database. Thus another save should cause an Insert to occur.
Also, keep in mind that the Delete of a Root needs to handle the Delete for all its children in code (unless you have Cascade Delete turned on int he database.)
Oh and avoid the #1 bug of UI code saving BOs:
Do NOT do this:
myBO.Save
Do this instead:
myBO = myBO.Save
You have to update the variable with the returned object.
Joe
Copyright (c) Marimer LLC