Root BusinessListBase and MarkAsChild()

Root BusinessListBase and MarkAsChild()

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


FreeAsInBeer posted on Thursday, March 22, 2007

Just trying to get my head around a few things, and need a bit of poking with the clue wand...

I have a BusinessListBase that is a root object. In its constructors I do NOT invoke MarkAsChild(), correct? I'd only invoke MarkAsChild for the collection if the collection was itself a property of another CSLA object?

However, in the constructors for the collection's items, I DO invoke MarkAsChild()?

i.e. the collection itself is not a child, but its items are (they are children of the collection).

Is there ever a time when the items in a collection would NOT be Mark(ed)AsChild?

The only reason I ask is I didn't invoke MarkAsChild in my collection's items, and so far everything is working fine (adding/edit). Having said that, I 've just started to look at deleting and n-level undo on the collection, and this has led me to these questions.

thanks

ajj3085 replied on Thursday, March 22, 2007

The only time you wouldn't call MarkAsChild for items that will be contained in a colletion is if the collection will be a subclass of EditableRootListBase.  But you'd only use that if each item in the collection may be saved by itself, outside the scope of the other items and the collection itself.

FreeAsInBeer replied on Thursday, March 22, 2007

Yeah, that makes a bit more sense now. Thanks for confirming it for me.

Copyright (c) Marimer LLC