Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# Querying With LINQ Query Operators Conversion Operators

Challenge 2 of 2: Conversion Operators - not liking my .ToList() code

Code: var numbers = Enumerable.Range(0, 10);

List<int> numList = numbers.ToList();

--- Fails: says numbers is not List<int>; did I use ToList()?

CodeChallenge.cs
var numbers = Enumerable.Range(0, 10);

List<int> numList = numbers.ToList();

1 Answer

Dale Severude
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Dale Severude
Full Stack JavaScript Techdegree Graduate 71,350 Points

The instructions are to convert the numbers variable to a List with a LINQ method. You have created a new variable named numList. The final answer still needs to be contained in the numbers variable.

Thanks... figured that out this morning. It was late when I posted.