C# Querying With LINQ Functional Programming in C# LINQ Method Syntax

I think I am very close - I have created the OrderByDescending LINQ query

Is there a syntax error here? it is not passing

NumberAnalysis.cs
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
Steven Parker
168,153 Points

It 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.