Complete the code to declare a list of integers.
List<int> numbers = new List<int> [1];The correct syntax to create a new list in C# uses parentheses () after the constructor.
Complete the code to filter numbers greater than 5 using LINQ.
var filtered = numbers.Where(n => n [1] 5);
The Where method filters elements. To get numbers greater than 5, use the greater than operator >.
Fix the error in the LINQ query to select names starting with 'A'.
var result = names.Where(name => name.[1]("A"));
The correct method name is StartsWith with capital S and W.
Fill both blanks to create a dictionary from a list using LINQ.
var dict = people.ToDictionary([1] => [2].Id);
In the lambda expression, the variable name must be consistent. Here, p is used both times.
Fill all three blanks to select and order names using LINQ.
var orderedNames = people.Select([1] => [2].Name).OrderBy([3] => [3]);
Use p as the variable in Select and OrderBy for clarity and consistency.
