rsbaker0 replied on Monday, October 05, 2009
Vlam100: ...
My design is as follows
ParticipantImport (editable Root)
ParticipantImportItem(editable child)
ParticipantImportItems(editable child collection of participantImportItem)
...
I'm a little confused by this, as it seems like ParticipantImportItem contains a list of itself, unless you meant this:
ParticipantImport (editable Root)
ParticipantImportItems(editable child collection of participantImportItem)
ParticipantImportItem(editable child)
A quirk of CSLA is that the "interesting" ancestor object of a child in a collection isn't usually the collection, which is the direct parent, but instead is the grandparent, which is parent of the collection.
If you are using managed properties, CSLA will assign the parent at the time the object is added to the collection, or, in the case of a direct relationship between a parent and child BO as indicated in your original hierarchy, at the time the child property is set to a child BO.
When working with child in a collection, a way to get a child that already has the parent attached is to call AddNew on the collection, which will return the partially populated child.