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 trialAmy Shah
25,337 PointsI think I am very close - I have created the OrderByDescending LINQ query
Is there a syntax error here? it is not passing
using System.Collections.Generic;
using System.Linq;
namespace Treehouse.CodeChallenges
{
public class NumberAnalysis
{
private List<int> _numbers;
public NumberAnalysis()
{
_numbers = new List<int> { 2, 4, 6, 8, 10 };
}
public IEnumerable<int> NumbersGreaterThanFive()
{
return _numbers.Where(n => n > 5);
}
public IEnumerable<int> ReverseNumbers()
return _numbers.OrderByDescending(n => n < 5);
}
}
1 Answer
Steven Parker
231,268 PointsIt looks like you are missing an open brace ("{
").
It would come before the body of the new method. The matching close brace is already at the end.
Also, check the lambda in your LINQ. The challenge didn't ask for the numbers to be limited this time, just re-ordered.