假设我有以下 2 个数组
string[] keys = new string[]{"Annalee Call","Bishop","Ash"};
MyClass[] vals = new MyClass[]{
new MyClass(){name = "Ash"},
new MyClass(){name = "Annalee Call"},
new MyClass(){name = "Bishop"}
};
基于键数组按名称对 MyClass 数组进行排序而不诉诸 for 循环的最佳方法是什么?