Lets say I have a structure as follows:
class A {
IEnumerable<B> BList {get;set;}
}
class B {
IEnumerable<C> CList {get;set};
int OrderId {get;set;}
}
class C {
int OrderId {get;set;}
}
and I want to return a list of As where it's BList is ordered by it's OrderId and for each B in that list , it's CList is also ordered by it's OrderId.
These are models I use with EF6, and classes A,B,C correspond to db tables.
I have spent some trying to 'linq-ify' this, but without success. Is it doable?
EDIT: duplicate of Sort a list and all its nested objects using Linq