Demonstrating the Query Results Changing Between Enumerations
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
public static void Main() {
int[] intArray = new int[] { 1, 2, 3 };
IEnumerable<int> ints = intArray.Select(i => i);
foreach (int i in ints)
Console.WriteLine(i);
intArray[0] = 5;
foreach (int i in ints)
Console.WriteLine(i);
}
}
Related examples in the same category