2007-07-16

A simple sort in C#

Here is a snippet that shows how to easily sort a class by a string property:

userList.Sort(
    delegate(Customer customer1, Customer customer2)
    {
        return customer1.No.CompareTo(customer2.No);
    });

Find.

No comments: