Imagine you have a list called List<Foo>.
Foo- an abstract class, so it may be FooA, FooB, FooCor FooD. And I would like to have an extension for List<T>where you can order these items by type, but sequentially.
For example, if I have 9 elements.
FooA, FooA, FooB, FooD, FooC, FooC, FooA, FooB, FooA
The type order will be sequentially.
FooA, FooB, FooC, FooD, FooA, FooB, FooC, FooA, FooA
I am trying so that the function can be ordered in the order you specify, in this case IE, it was:
new[] { typeof(FooA), typeof(FooB), typeof(FooC), typeof(FooD) }
I tried to create this extension but get nothing. Can you help a little? I assume I can accomplish this with LINQ.