■ orderby 키워드 질의 형식 사용하기 (thenby 쿼리)

----------------------------------------------------------------------------------------------------

using System;

using System.Collections.Generic;

using System.Linq;

 

string[] stringArray = { "Jimmy", "Kevin", "Jacob", "Tom", "Kelly", "Steve", "Bob", "Jane", "Jennifer" };

 

// thenby 쿼리

IEnumerable<string> result = from source in stringArray

                             orderby source.Length, source

                             select source;

 

foreach(string source in result)

{

    Console.WriteLine(source);

}

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG