OrderBy()

A LINQ operation that sorts a sequence by a selected key.

What does OrderBy() do in C#?

OrderBy() — A LINQ operation that sorts a sequence by a selected key.

class NameSorter
{
    IEnumerable<string> Sort(IEnumerable<string> names)
    {
        return names.OrderBy(name => name);
    }
}

Level: Freelancer · More C# terms at this level

Updated