Non linear Prefetch SubPath

Posts   
 
    
Samuel
User
Posts: 9
Joined: 04-Dec-2004
# Posted on: 04-Dec-2004 14:18:23   

Is it possible to have 2 branches with Prefetch subPath.Add as it is at prefetchPath.Add?

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 04-Dec-2004 14:32:03   

Yes, that's possible. Be sure to grab the prefetchpathelement when you add the first subnode, so you're adding the subpath node to the same parent node.

So do NOT do this:


// bad, doesn't work:
IPrefetchPath path = new PrefetchPath((int)EntityType.CustomerEntity);
path.Add(CustomerEntity.PrefetchPathOrders).SubPath.Add(OrderEntity.PrefetchPathOrderDetails);
path.Add(CustomerEntity.PrefetchPathOrders).SubPath.Add(OrderEntity.PrefetchPathProducts);

but do:


// good:
IPrefetchPath path = new PrefetchPath((int)EntityType.CustomerEntity);
IPrefetchPathElement ordersNode = path.Add(CustomerEntity.PrefetchPathOrders);
ordersNode.SubPath.Add(OrderEntity.PrefetchPathOrderDetails);
ordersNode.SubPath.Add(OrderEntity.PrefetchPathProducts);

Frans Bouma | Lead developer LLBLGen Pro
Samuel
User
Posts: 9
Joined: 04-Dec-2004
# Posted on: 04-Dec-2004 14:38:25   

Wow great response timesmile . Great product also. thanks