A cool List .Sort() extension method via lambda

Here’s an awesome List<T>.Sort() extension method:

    public static List<T> Sort<T,U> ( this List<T> Source, Func<T,U> OrderFunc ) {
return Source.OrderBy( OrderFunc ).ToList();
}

Use it with a lambda like this:

    MyList<SomeClass> mylist = PopulateList();
    mylist = mylist.Sort( i => i.Sequence ); 
ow that’s an awesome sort function!

Or like this for non-:

    MyList<int> mylist = PopulateList();
    mylist = mylist.Sort( i => i );

Now that’s a cool sort function!

Rob