Hi all,
I have a simple tree like this one:
class Node
{
String Name{ get; set; }
Node Parent{ get; set; }
IList<Node> ChildNodes{ get; set; }
}
What I need to do is retrieve the entire tree in one single round-trip to
the db and I can achieve that by loading the entire table and letting the
identity map works for me, it works like a charm.
Now I need to achieve the same result but issuing a where condition, e.g.
filtering all the nodes whose Name starts with "Foo*". The query works fine
and, using NH Proof, I can see that the correct list of Node(s) are loaded
but then accessing to the ChildNodes property issues a new sql command to
load children.
Is there a way to explain NH to use the same "condition" while loading the
entire graph in order to go on using a single round-trip to the db?
Thanks in advance, regards
.m
___________________________________
Mauro Servienti | Microsoft MVP - Visual C#
MCTS /MCPD- | IM: [email protected]
smime.p7s
Description: S/MIME cryptographic signature
