The same you did when you first loaded the form.
The thing is that I didn't do anything to get the child collections. I use databinding and rely on the databinding mechanism to get the child-collections for me. And it works fine.
The only problem is refetching the entity-graph in case of a cancel.
I can loop through the child-collections: (this snippet checks which childcollections have changes and uses the local variable m_Entity of type EntityBase)
List<IEntityCollection> childCollections = m_Entity.GetMemberEntityCollections();
for (int i = 0; i < childCollections.Count; i++)
{
IEntityCollection col = childCollections[i];
if (col != null && col.ContainsDirtyContents)
{
if (!m_IsDirty) m_IsDirty = true;
m_UnitOfWork.AddCollectionForSave(col);
}
}
I could use a similar approach to refetch the collection, but I don't see an appropriate method to do this. If I use GetMulti(null), I get all order-details and not just the details related to this order.
So, is there a way to refresh a collection taking into account the relation with it's parent entity? (Without manually creating a filter, I mean)