Re: Can not directly mark a child object for deletion - use its parent collection?

Re: Can not directly mark a child object for deletion - use its parent collection?

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


Jagsoft posted on Monday, July 17, 2006

then you should be able to just call Clear() on the collection, because that will automatically mark all the child objects for deletion and move them to the deletedList.

It seems as though this is an incorrect statement, when you call clear on the collection it does remove all of the objects from the collection but since I do not see where the CSLA frame work overrides the clear method it does not move items to the deleted list.

If you test this by adding an item then calling clear and then call update nothing is deleted. And the collection does not contain any objects to be updated.

This is just my observation while learning to use this framework. (at least in version 2.0.2)

Copyright (c) Marimer LLC