I have a query using lambda expressions and I want to be able to sort from a column in a table that is a child collection of a parent table. The query looks like this:
var query = ctx.Timelines.Include("Rule.DocumentRules").Where(...).OrderBy(o => o.Rule.DocumentRules.OrderBy(t => t.SortOrder));
The SortOrder column resides 3 levels deep under the Timelines Entity and I don't know which extension to use to access it. When I use the code above, I get an error "DbSortClause expressions must have a type that is order comparable. Parameter name: key". I get the same error if I use a Select extension instead of the 2nd OrderBy. Does anyone know how I can sort by this column? This "SortOrder" column is not a primary or foreign key.
Thanks