I have something like:
Customer
custid
Order
custid
orderid
Orderitem
orderid
OrderDesc
orderid
orderDesc
I am attempting a fetchEntity to return a Customer Entity with all OrderItems for the customer sorted by the order description. In the designer I have orderdesc as a field mapped on related fields as part of the OrderItem entity.
I have tried the following with no success
Dim Cust As New CustomerEntity(custId)
Dim prefetchPath As New PrefetchPath2(CInt(EntityType.CutomerEntity))
Dim referencePath As IPrefetchPathElement2 = CustomerEntity.PrefetchPathOrder
Dim sortClause As ISortClause = SortClauseFactory.Create(OrderDescFieldIndex.OrderDesc, SortOperator.Ascending)
referencePath.SubPath.Add(ReferenceEntity.PrefetchPathOrderItem)
prefetchPath.Add(referencePath)
adapter.FetchEntity(Cust, prefetchPath)
Do I have to create a Typed List? Any suggestions?