Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# Querying With LINQ Query Operators Conversion Operators

Ramy Elsaraf
Ramy Elsaraf
7,633 Points

What is the problem

Convert the numbers variable to a List with a LINQ method?

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

1 Answer

28,538 Points

While the instructions aren't too specific on this task they want the list to be stored in the numbers variable. So you should either store the result of your second line in the numbers variable, or you can simply add the ToList method directly to the code you had written in the first task like this:

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