I have a List.
Where T is a class have properties like int and other parameters
E.g.
ID Name
1 Apple
2 Banana
3 Test
Now i have another List which specify order
Like 2,1,3
So i want to sort them using 2,1,3 like Banana,Apple and then Test
How can i implement this wihh IComaparer
Currently i tries this but it failed
test = test.OrderBy(p=> SortableIntList.Contains(p.ID));
To quickly get it working,
To make it more efficient, you may want to store your sort order in a dictionary (ID => position) and then call it like