Hi All.
I have never bothered with these prefetch paths but wish to know how it works. The manual has the following example:
' VB.NET
Dim orders As New OrderCollection()
Dim prefetchPath As IPrefetchPath = New PrefetchPath(CType(EntityType.OrderEntity, Integer))
prefetchPath.Add(OrderEntity.PrefetchPathCustomer)
Dim filter As IPredicateExpression = New PredicateExpression()
filter.Add(PredicateFactory.CompareValue(OrderFieldIndex.EmployeeId, ComparisonOperator.Equal, 2))
orders.GetMulti(filter, prefetchPath)
I run the code and viewed with the profiler. I can see that 2 queries are generated - Just as the manual says. The first query i can understand - Filter Orders to only return orders for Emp 2. But where does the 2nd query's (Customers) data go? And how do i access it as i can only see a collection of orders.
Does it mean that if i do orders(1).Customers() after the prefetch LLBLGen won't make a query to find the customers because it already knows it?