Deleting a child object though it's root object

Deleting a child object though it's root object

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


jender624 posted on Thursday, February 08, 2007

Hi everybody...let me explain my situation:

I have an editable root object that contains three editable child objects of an identical type.  I am attempting to mark the child objects as deleted as normally would be done through an editable collection's Remove method.  The difference here, of course, is that I don't have access to a Remove method or anything similar through the editable root object. 

How do I mark the child objects as deleted so I can use the Save method of the root to commit the delete to the database?  I can't use ChildObject.Delete, because a child cannot directly mark itself as deleted.

Thanks!

jender624

 

jender624 replied on Thursday, February 08, 2007

I figured it out...I'm overloading the MarkDeleted method of the business base object in the child.  Then I'm calling that method from the root.  It seems to do the trick.  Thanks anyway!

Copyright (c) Marimer LLC