Hi there!
Let me start out by saying that I have tried searching around on the forum to find the answers, but with no luck
I run an application which uses LLBLGen Pro 2.5 using Adaption mode.
My problem is that I would like to create a SortExpression (SortClause) which sorts on a child of the entity being fetched. All the examples I can find does it using SelfServicing and PrefetchPaths, I tried to convert that to Adaption but with no luck, when I look at the SQL the FetchEntityColletion fires there is no sort at all
For simplicity let's say I have an SerialEntity which is attached to an ItemEntity. Then I would like to show a list of Serials (for no specific Item, just all in the system) but sorted on the Item which they are attached to.
Now the code I tried (based on the SelfServicing Collection.GetMulti examples I found) is:
Dim sorter As New SortExpression()
sorter.Add(New SortClause(ItemFields.Number, Nothing, SortOperator.Ascending))
pp = New PrefetchPath2(CType(EntityType.ItemEntity, Integer))
pp.Add(ItemEntity.PrefetchPathSerial, 1, Nothing, Nothing, sorter)
Dim ec As New EntityCollection(Of ItemEntity)
DataAccessAdapter.FetchEntityCollection(ec, nothing, 200, Nothing, pp)
It gets the ItemCollection fine, but the SQL it produces does not include any "Order by ...."
Please someone release me from the agony