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 trialCalvin Secrest
24,815 PointsBummer! Did you use the 'ToList' method?
Convert the numbers variable to a List with a LINQ method.
Please help!
var numbers = Enumerable.Range(0, 10);
var numbers = Enumerable.Range(rec => rec.Where == "numbers").ToList();
2 Answers
Marco Koopman
5,290 PointsYou need to add .ToList(); to the first var: numbers.
Also you need to make the second variable a List by using "List<int>" this specifies what type you are going to put in the list. Rename the second variable to something else too!
Code:
var numbers = Enumerable.Range(0, 10).ToList(); List<int> numberList = numbers.ToList();
Happy coding!
Carel Du Plessis
Courses Plus Student 16,356 Pointswhy you do you have List<int> numberList = numbers.ToList(); ?
is var numbers not already converted to a list?
Carel Du Plessis
Courses Plus Student 16,356 Pointshere is my code for the challenge
var numbers = Enumerable.Range(0, 10).ToList();
Calvin Secrest
24,815 PointsCalvin Secrest
24,815 PointsI figure the error why it didn't work and thank you for your assistance.