3 ms·
AnArray.Sort(e -> e.Salary) and if there's no built-in way to compare two Salary objects (let's say they're complex objects), then you come up with an interface
by pbz 14y ago
AnArray.Sort(e -> e.Salary) and if there's no built-in way to compare two Salary objects (let's say they're complex objects), then you come up with an interface that the sorting function would use and the objects would implement. This way you let the objects compare themselves.