Hi everyone and Happy New Year,
If I am instantiating an EditableRootCollection with existing EditableChild content BO, how does the mParent field in each BO get set?
If I look at example DataPortal_Fetch code for an Editable Collection (in ProjectResources for example) it just creates a DataReader and passes the reader to the 'Get' factory method of the Child BO class.
With dr
While dr.read
Add(ChildBOClass.GetEditableChild(dr)
End While
End With
Now if I highlite "Add", right click and "Go to definition", VS points me to the .Net Collection(of T).Add method.
If I search CSLA for where SetParent( ) is called (or where mParent is set), I can only find it in one place, an override method for InsertItem(int, T) in BusinessListBase.
The only thing I can think of is that Collection(of T).Add internally uses the InsertItem() method to actually add the object to the end of the collection. Since CSLA overrides InsertItem to update mParent, it gets updated as a part of the "standard" Add method call.
Have I completely missed something here or is this assumption correct?
Thanks.
BBM
Thanks Rocky.
But how did you know that Collection(of T).Add uses InsertItem? I couldn't find that documented anyplace.
BBM
Copyright (c) Marimer LLC