LINQ · interview question
Which LINQ call executes the query immediately?
Multiple choiceEasy
Answer and explanation
Correct answer
C. ToList
Why
Conversion and aggregation operators (ToList, ToArray, ToDictionary, Count, Sum, First...) enumerate the source immediately. Projection and filtering operators are deferred.
Test yourself on LINQ
A free test with instant, explained results. No account needed.