using System.Collections.Generic;
public string Campo { get; set; }
public static void Main()
var s = new List<string> { "hola", "hello33", "hillos" };
var T = from e in s orderby e.Length select e;
var T2 = s.OrderBy(x => x.Length);
Console.WriteLine("Con query syntax: ");
Console.WriteLine("\nCon method syntax:");
Console.WriteLine("\nAhora con una clase: ");
var lClases = new List<AlgoBueno>() {
new AlgoBueno { Campo = "hola12" },
new AlgoBueno { Campo = "hola4312" },
new AlgoBueno { Campo = "hola" },
new AlgoBueno { Campo = "hola2" }
var elementos = lClases.Select(x => new { Campo = x.Campo }).OrderBy(x => x.Campo.Length);
foreach (var l in elementos)
Console.WriteLine(l.Campo);