Prefetch adapter with two sublevels

Posts   
 
    
Dicki
User
Posts: 1
Joined: 12-Jul-2012
# Posted on: 12-Jul-2012 16:37:21   

I'm a newcomer and I'm working through the examples in "Generated code - Prefetch paths, Adapter". I worked out how to retrieve Northwind orderdetails using subpath. But I want to retrieve the productname from Products as well. Is this possible with subpath and could you give me example code like below?

EntityCollection<CustomerEntity> customers = new EntityCollection<CustomerEntity>();
PrefetchPath2 prefetchPath = new PrefetchPath2(EntityType.CustomerEntity);
prefetchPath.Add(CustomerEntity.PrefetchPathOrders).SubPath.Add(OrderEntity.PrefetchPathOrderDetails);
prefetchPath.Add(CustomerEntity.PrefetchPathOrders).SubPath.Add(OrderDetailEntity.PrefetchPathProduct); // <-- not working

Off topic: VisitingAddress is not part of the Northwind database I have.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 12-Jul-2012 19:59:08   
EntityCollection<CustomerEntity> customers = new EntityCollection<CustomerEntity>();
PrefetchPath2 prefetchPath = new PrefetchPath2(EntityType.CustomerEntity);
prefetchPath.Add(CustomerEntity.PrefetchPathOrders).SubPath.Add(OrderEntity.PrefetchPathOrderDetails).SubPath.Add(OrderDetailEntity.PrefetchPathProduct);