I need to represent different types of documents in a logical order. So I have a list of objects with IDs. I need to make a comparer which orders these objects by a "manual" rule. Order by id must be 2,32,5,12,8,43... and so on.
I use LINQ
documents.OrderBy(doc=> doc.Id, new DocumentsComparer<int>());
public class DocumentsComparer<T> : IComparer<int>
{
...???...
}
How to make such comparer?