Challenge 2: The Same Dictionary Query, Both LINQ Syntaxes — Possible Solution ==================================================================== Program.cs: Dictionary ages = new() { ["Alice"] = 30, ["Bob"] = 25, ["Carol"] = 41, ["Dave"] = 19 }; // Method syntax var methodResult = ages.Where(pair => pair.Value >= 30); // Query syntax var queryResult = from pair in ages where pair.Value >= 30 select pair; Console.WriteLine("Method syntax:"); foreach (var pair in methodResult) Console.WriteLine($" {pair.Key}: {pair.Value}"); Console.WriteLine("Query syntax:"); foreach (var pair in queryResult) Console.WriteLine($" {pair.Key}: {pair.Value}"); Output: Method syntax: Alice: 30 Carol: 41 Query syntax: Alice: 30 Carol: 41 Explanation: Both queries express the identical filter -- age 30 or older -- just written two different ways. Method syntax chains Where() as a fluent call; query syntax uses the from/where/select keywords built directly into C#'s own grammar. Both compile down to equivalent LINQ calls under the hood, which is why they produce byte-for-byte identical results here. WHY THIS WORKS AS AN ANSWER ------------------------------ This writes the same query twice, once in each LINQ syntax the chapter introduces, over a Dictionary rather than an array or List, confirming both syntaxes are genuinely equivalent and that LINQ applies uniformly across different collection types.