Search notes:

System.Linq.Enumerable (class)

System.Linq.Enumerable provides the standard query operators functionality for objects that implement System.Collections.Generic.IEnumerable<T>.
The functionality of Enumerable is implemented as static methods.

OrderBy

The following PowerShell example tries to demonstrate how a System.Collections.Generic.Dictionary<TKey, TValue> object can be sorted (in SQL parlance: ordered by) by the value of the dictionary's entries rather than its keys.
[System.Collections.Generic.Dictionary[String, Int]] $wordCount = new-object 'System.Collections.Generic.Dictionary[String, Int]'

foreach ($item in 'three', 'four', 'four', 'two', 'four', 'three', 'one', 'two', 'four', 'three') {
   $wordCount[$item] = $wordCount[$item] + 1
}

[System.Linq.Enumerable]::OrderBy(
    $wordCount,
    [Func[ System.Collections.Generic.KeyValuePair[String, Int] , # This is the type of $p in the next anonymous code block
           Int                                                    # This is tye type of what the anonymous code block returns
   ]] { param($p) $p.Value })
Github repository .NET-API, path: /System/Linq/Enumerable/OrderBy.ps1
Micheal Soren's High Performance PowerShell with LINQ was very helpful when I tried to understand the OrderBy functionality.

Range

using System;
using System.Linq;
using System.Collections.Generic;

class Prg {

   static void Main() {

      Int32 start = 12;
      Int32 count =  7;

      IEnumerable<Int32> range = Enumerable.Range(start, count);
      foreach (Int32 elem in range) {
         Console.WriteLine(elem);
      }
   }
}
//
// 12
// 13
// 14
// 15
// 16
// 17
// 18
//
Github repository .NET-API, path: /System/Linq/Enumerable/Range.cs

See also

The System.Linq.Queryable class complements Enumerable and provides standard query operators for obj that implement System.Linq.IQueryable<T>.

Index