LINQ sample:
var numbers = new List
numbers.Add(1);
var query = from n in numbers select n * 10;
numbers.Add(10);
foreach (int i in query)
{
Console.WriteLine(i);
}
Console.ReadLine();
The number 10 is added into the query result, this is called lazy evalution or deferred.
This feature seperate the query construction from query execution
No comments:
Post a Comment