I have two classes:
class Parent
{
public virtual Child Child { get; set; }
}
class Child
{
public virtual IList<GrandChild> GrandChildren { get; set; }
}
I have an instance of Parent
loaded from my ISession
, Parent.Child
is lazy loaded (NOT loaded at this point). Child.GrandChildren is also lazy loaded.
If I do this:
session.Save(new Parent { Child = existingParent.Child } );
I get collection [Child.GrandChildren] was not processed by flush()
If I cause existingParent
's Child
property to be loaded, simply by accessing it:
var x = existingParent.Child.Name
the problem goes away. Why is this happening, and how do I solve it - preferably without having to change my fetching strategy?
*Edit: * Parent has a FK to Child
I'm using NH 2.1.2.4000
Thanks