This question as an extension from this question: Sorting Dynamic LINQ By Collection Property
I have a query that can be strongly expressed like this (works):
qry.OrderBy(x => x.Locations.Where(l => l.SequenceNo == 1).Min(l => l.Location.Name))
I've tried expressing this like this (does not work):
qry.OrderBy("Locations.Where(SequenceNo=1).Min(Location.Name)");
This is not recognized however.
I cannot find any official documentation for Dynamic Linq either.
Is this scenario possible/supported with Dynamic Linq?
EDIT: The example was incomplete as it did not show the complete sample. I've decided to let the code remain and update below instead (neither statements work).
qry.OrderBy(x => x.Locations.Where(l => l.SequenceNo == 1).Min(l => l.Location.Name)).ThenBy(v=>v.ID);
qry.OrderBy("Locations.Where(SequenceNo=1).Min(Location.Name), ID");
I need to sort on the ID as well to have an unique result set.
I guess the issue now isn't specific to Dynamic Linq but rather how the expressions are linked.