What ???!!!

Vean lo que es este trozo de codigo, y me parece que habla por si solo. Si… es lo que Uds piensan…es LINQ, Language INtegrated Query.. que te permite hacer consultas en pleno
C# y VB, y no solamente a bases de datos, podes hacerlo como muestra el primer ejemplo, a un simple arreglo.


using System;

using System.Query;

using Danielfe;


class Program

{

    static void Main(string[] args)

    {

        string[] aBunchOfWords = {”One”,”Two”, “Hello”, 

  “World”, “Four”, “Five”};


        var result =    

            from s in aBunchOfWords // query the string array 

            where s.Length == 5     // for all words with length = 5

            select s;               // and return the string


        //PrintToConsole is an Extension method that prints the value

        result.Print();

    }

 }

y para que lo vean como funcionaría con un SQL Server, va un ejemplo, y me parece que no hace falta explicarlo

using System; using System.Query; using Danielfe; using System.Data.DLinq; //DLinq is LINQ for Databases using nwind; //Custom namespace that is tool generated class Program { static void Main(string[] args) { Northwind db = new Northwind(”Data Source=(local);Initial Catalog=Northwind;Integrated Security=True”); TableCustomers> allCustomers = db.GetTableCustomers>(); var result = from c in allCustomers where c.ContactTitle.Length == 5 select c.ContactName; result.Print(); } }

Proyecto LINQ