A linq Query can be executed more than once.
Source Code
Output
Debugging
Source Code
using System.Linq;
using System;
namespace GroupJoin
{
class Program
{
public static void Main()
{
int[] number = { 101, 102, 103, 104, 105 };
var final = from num in number
where num > 102
select num;
foreach (var item in final)
{
Console.WriteLine(item);
}
number[1] = 200;
Console.WriteLine("----after---");
foreach (var item in final)
{
Console.WriteLine(item);
}
Console.ReadLine();
}
}
}
Output
Debugging