I have a list1 like this :
{A,B,C,D,E,F} I have another list2 that list2 count is equal with list1 count (6=6) :
{50,100,14,57,48,94} I want sort list1 according to list2, that list2 to be sorted ascending.
{14,48,50,57,94,100} as a result :
{C,E,A,D,F,B} I used the following code. But the result is not sorted
list1= list1.OrderBy(d => list2.IndexOf(d)).ToList();