C# Querying With LINQ Functional Programming in C# Actions and Funcs

Ahmed Awadallah
Ahmed Awadallah
5,637 Points

The question s too vague, I can't move ahead.

It is asking for a public Func field, so I assume that this is some sort of an abstract method in a way. where should I write the implementation? is it in the declaration itself or should I define a Main function to declare it?

Program.cs
using System;

namespace Treehouse.CodeChallenges
{
    public class Program
    {
        public Func<int,int> Square = delegate(int number) {return number * number;};

        /*public static Main(string[] args)
        {
            Square = delegate(int number)
            { 
                return number*number;
            };
        }*/
    }
}

1 Answer

Steven Parker
Steven Parker
168,518 Points

Your solution is correct (and no Main is needed). But the challenge is being overly picky about formatting. Try adding a space after the comma in the Func descriptor.

You might want to report this as a bug to Support.