Deferred Query Execution : Deferred Query : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » Deferred Query »

 

Deferred Query Execution








    
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass {
    public static void Main() {
        int[] numbers = new int[] { 5, 4, 1, 3, 9 };

        int i = 0;
        var q =
            from n in numbers
            select ++i;
        foreach (var v in q) {
            Console.WriteLine("v = {0}, i = {1}", v, i);
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» Deferred Query