【c#-使用LINQ根据多个表中的多个属性有条件地对元素进行排序】教程文章相关的互联网学习教程文章

c# – 按内存列表中的另一个内存列表排序【代码】

可以通过另一个列表对内存列表进行排序(第二个列表将是参考数据源或类似的东西)?public class DataItem {public string Name { get; set; }public string Path { get; set; } }// a list of Data Items, randomly sorted List<DataItem> dataItems = GetDataItems();// the sort order data source with the paths in the correct order IEnumerable<string> sortOrder = new List<string> {"A","A.A1","A.A2","A.B1" };// is the...