I have created a parent class which has a list of children (composition).
I manually create a parent and add a child using this code:
parent = Parent.NewParent();
child = parent.Children.AddNew();
parent.Save();
However when parent.UpdateChildren() is called the varible parent._childrenHydrated is false and therefore the new child is not added to the database.
I think that the solution is to add the dollowing line to parent.Dataportal_Create():
parent.Dataportal_Create()
{
...
_childrenHydrated = True;
}
This will ensure that any new children will be saved correctly.