Query with Intentional Exception Deferred Until Enumeration : select : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » select »

 

Query with Intentional Exception Deferred Until Enumeration








    
 

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
    public static void Main() {
        string[] strings = { "one", "two", null, "three" };

        Console.WriteLine("Before Where() is called.");
        IEnumerable<string> ieStrings = strings.Where(s => s.Length == 3);
        Console.WriteLine("After Where() is called.");

        foreach (string s in ieStrings) {
            Console.WriteLine("Processing " + s);
        }

    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» select