Friday, 12 November 2010

Using LINQ to Sort Data

Usually to sort objects with a Sort() method on a list the objects need to have a Comparer class that is used to compare the object types. This is fine but gets old fast when having to implement this multiple times for different object types.

This is where Linq comes in

Take a look at this method below: I cant sort in SQL as the properties I need to sort on don’t exist in the table.

No comments:

Post a Comment