質問

Given a multi level object graph being called using Future as:

var Dads = db.Session.Query<Parent>().Where(P => P.EntityKey == Id)
             .ToFuture<Parent>();
var Kids = db.Session.Query<Kid>().Where(K => K.Parent.EntityKey == Id)
             .ToFuture<Kid>();

when I call var Dad = dads.ToList() I see the batch go across the wire and show in profiler.

Problem is when enumerating the collection it is still sending one off queries to the db

Eg.

for each (Kid kid in Dad.Kids) // This seems to hit the database 
{
   Teach(kid);
}

Sends a SQL query and hits the database to get each kid. Why is the object graph not populated? or is this expected behavior?

正しい解決策はありません

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top