I have this class:
public class Foo
{
public int Left {get;set}
public int Right {get;set;}
public static IEnumerable<Foo> Sorted(IEnumerable<Foo> foos)
{
return foos.OrderBy(x=>x.Left).ThenBy(x=>x.Right);
}
}
Now given a class:
public class Bar
{
public Foo Foo {get;}
public IEnumerable<Bar> Sorted(IEnumerable<Bar> bars)
{
//Sort the bars by this logic: the order of bars is equivalent to the order of their Foos when sorted by Foo.Sorted().
}
}
I'm not sure what to put in my method to perform the correct sort.
Edit: I am also aware that a pure LINQ statement might be had by crafting a IComparer<T> class to perform a item-granular comparison, but the given foos.OrderBy... LINQ expression is already the intended outcome...