Could you explain on the following example what a deferred execution is and what materialization is? What will the output be?

string[] animals = { "dog", "cat", "crocodile", "Peter" };
var list = new List<string>(animals);
IEnumerable<string> query = list.Where(p => p.Length == 5);
list.Remove("Peter");
Console.WriteLine(query.Count());

Experience Level: Not defined
Tags: .NETC#LINQPerformance

Answer

Comments

No Comments Yet.
Be the first to tell us what you think.