There is a sheet

public class Field { public string Name; public int ID; } var list = new List<Field>(); 

and Dictionary

 var FieldOrder = Dictionary<int, int>(); // Первый параметр ID, второй - порядковый номер в списке 

It is required to sort the List according to the order defined in the Dictionary

Values ​​in Dictionary can be less than in a sheet, and List elements that do not have an Id in a Dictionary should be placed at the end of the sheet.

  • you need to use the method OrderBy - Grundy

0