Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace Articulo.CSharp.MetodosExtension
  5. {
  6.     public sealed class MetodoExtensionOrderBy
  7.     {
  8.         public static void Main()
  9.         {
  10.             // DeclaraciĆ³n e inicializaciĆ³n de un arreglo de enteros:
  11.             int[] enteros = {29, 13, 2, 5, 7, 37, 71};
  12.            
  13.             // Ordenamiento de los elementos:
  14.             var arregloOrdenado = enteros.OrderBy ( num => num);
  15.            
  16.             Console.WriteLine ();
  17.            
  18.             foreach (var num in arregloOrdenado)
  19.             {
  20.                 Console.Write ("{0}\t", num.ToString());
  21.             }
  22.            
  23.             Console.WriteLine (Environment.NewLine);
  24.         }
  25.     }
  26. }