i want to use my custom extension method to order a list of objects. it\'s just a sample so it uses a bubblesort. my current state:
public static IOrderedQue
You are calling comparer.Compare(Result[j - 1], Result[j]) now. That is wrong, since it doesn't take the key into account as you said.
You should get the key by calling the Func keySelector, and match that one:
IComparer comparer = Comparer.Default;
var x = keySelector(Result[j - 1]);
var y = keySelector(Result[j]);
if (comparer.Compare(x, y) > 0)
{
...
}