I've seen http://stackoverflow.com/questions/3565249/ordering-sub-items-within-ordered-items-in-a-linq-to-entities-query which suggests that there is no way of getting the repository to return sub-items in an entity graph in a specific order.
If that's right, any thoughts on how to order the items in an EditorFor ?
i.e.
//This works but returns a random order
<%: Html.EditorFor(model => model.HPERDET.HORDERS) %>
//This errors with "Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions."
<%: Html.EditorFor(model => model.HPERDET.HORDERS.OrderBy(m=>m.APP_DATE)) %>
//presorting the HORDERS into
//a public IOrderedEnumerable<HORDER> SortedHorders { get; set; }
//and ordering in my view model works, but breaks the binding because
//the generated html inputs no longer have the correct hierarchical names
<%: Html.EditorFor(model => model.SortedHorders) %>
So is there a way to sort the sub-entities in graph in order to use them with EditorFor without resorting to assembling POCO objects duplicating the EF ones in all but order ?