using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Toolbox.Library { public static class SortExtensions { /// /// Sort one collection based on keys defined in another /// /// Items sorted public static IEnumerable SortBy( this IEnumerable itemsToSort, IEnumerable sortKeys, Func matchFunc) { return sortKeys.Join(itemsToSort, key => key, matchFunc, (key, iitem) => iitem); } } }