FieldManager.GetChildren & ObjectFactoryFieldManager.GetChildren & ObjectFactory
Old forum URL: forums.lhotka.net/forums/t/7689.aspx
Kevin Fairclough posted on Monday, September 28, 2009
I need to cascade data updates in the ObjectFactory to children, does the FieldData contain children of children? or do I have recursively call GetChildren for each child?
TIA
Kevin
JonnyBee replied on Monday, September 28, 2009
Hi,
FieldManager contains only the fields of one of an object - so you will have to go recursively to get the grandchilden and their children.
/jonnybee
Kevin Fairclough replied on Tuesday, September 29, 2009
ThanksKevin Fairclough replied on Thursday, October 01, 2009
I'm looking at the CSLA source, how does the Child_Update get cascaded
to grand-children etc in the current DataPortal, the FieldManager only gets the current children and
calls ChildDataPortal.Update. Does the BO developer have to manually call
FieldManager.UpdateChildren() on the child object's Child_Update to
update grandchildren? I thought this was automatic using FieldManager.
JonnyBee replied on Thursday, October 01, 2009
Hi,
The BO developer will have to call FieldManager.UpdateChildren in the child objects Child_Update because you may want to send additional/different parameters to the child_Update method.
For each level you have dynamic methods called (dynamic in terms of parameters) - and we use that a lot. Imagine for example sending Parent from the previous level into the Child_Insert or Child_Update method (and not the list - which is the child objects parent) .
Kevin Fairclough replied on Friday, October 02, 2009
Thanks JonnyBee
This Parent thing is confusing me a little I think because of the lists, the real parent of the object is not the list.
Copyright (c) Marimer LLC