tags:

views:

68

answers:

1

I want to sort a collection by one of the properties which is a string, but i dont want to sort alphabetically.

Here is my code

 IEnumerable<Item> items = Repository.Query<Item>().OrderBy(r=> r.Status)

Status is a string but i want to sort in a particular order (not alphabetically)

how do i inject a custom sorter in the above syntax.

+7  A: 

Order by has an overload that takes IComparer.
Take a look here.

Itay