Specify way to load certain children explicitly
Issue #20
invalid
Is there a way to explicitly load children after the initial object is loaded?
My use case is: 1. Load initial object. 2. Lazily load specified child objects. 3. If we run out of memory I want to null those children so that I can repeat step 2 at a later date.
Comments (5)
-
-
reporter GetChildren returns all the children. How does one use GetChild to just return one child?
-
GetChildren
doesn't 'return' the children, it loads them from database and assign them to the properties.GetChild
does the same but only for the specified child, that seems to be what you're looking for:// Loads all the children of the object 'foo' from the database conn.GetChildren(foo); // Loads the child 'Bar' from the database conn.GetChild(f => f.Bar); // Lambda version, compiler safe conn.GetChild("Bar"); // <-- Equivalent
-
reporter - changed status to resolved
-
reporter - changed status to invalid
- Log in to comment
Have you tried
GetChildren
method? You also haveGetChild
method if you want to load only a specific child.