How do I re-write this sort code sample so it's using a generic extension instead of the second line?
I would like something like thi
var foosSorted = Unit.Foos().MyGenericSortFunction();
My working code
var foosSorted = Unit.Foos(); // Not sorted yet
foosSorted.Sort((x, y) => string.Compare(x.Name, y.Name));
How far I got with the generic extension
public static class ObjectExtension
{
public static T Sort<T>(this T list) where T : ???
{
return list.Sort((x, y) => string.Compare(x.Name, y.Name));
}
}