The World’s Leading Microsoft .NET Magazine
   
 
««
December 2008
»»
SM
T
WTFS
  123456
78910111213
14151617181920
21222324252627
28293031

Mailing List

Jon Box Blog

LINQ to show up in several places

LINQ (.NET Language Integrated Query) will be very productive for developers and will add value to .NET applications.  It was heavily emphasized in one of the PDC keynotes which included Hejlsburg, Box, Anderson, and Guthrie.  See one of the accounts at TSS.  There is now a MSDN LINQ site and a site for development futures.

Consider this snippet in C# 3.0 that queries for a specific length, orders the result set, and returns in an enumerable reference:

class App
{
    static void Main() {
        String[] names = {“Burke”, “Connor”, “Frank”, “Everett”, “Albert”, “George”, “Harris”, David” };
        IEnumerable<string> expr = from s in names
            where s.Length == 5
            orderby s
            select s.ToUpper();
        foreach (string item in expr)
        {
            Console.WriteLine(item);
        }
    }
}

This blog is created and maintained by the author of the page and in no way associated with SYS-CON Media or .NET Developer's Journal. The author of the blog assumes all liability and responsibility personally for the content of the page.
www.blog-n-play.com is a registered trademark (78553120) of SYS-CON Media.