Microsoft
70-516 · Question #146
You have executed the Where query extension method on your collection, and it returned IEnumerable of Car, but you want to assign this to a variable whose type is List Of Car. How can you convert…
The correct answer is C. Use the ToList() query extension method. See the full explanation below for the reasoning.
Question
You have executed the Where query extension method on your collection, and it returned IEnumerable of Car, but you want to assign this to a variable whose type is List Of Car. How can you convert the IEnumerable of Car to List Of Car?
Options
- AUse CType (C# cast).
- BIt can't be done.
- CUse the ToList() query extension method.
- DJust make the assignment
How the community answered
(53 responses)- A15% (8)
- B4% (2)
- C75% (40)
- D6% (3)
Community Discussion
No community discussion yet for this question.