C# Querying With LINQ Functional Programming in C# Lambda Expressions

Giulio Vannini
Giulio Vannini
21,922 Points

This challenge is making fun of me..

The syntax here is correct. However the challenge is not passing saying that "i must use the same variable names in the parameters". Any idea of what it may be wrong?

Program.cs
using System;

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

        public Action<int, Func<int, int>> DisplayResult = int result, Func<int, int> function =>
        {
            Console.WriteLine(function(result));
        };

        static void Main(string[] args)
        {

        }
    }
}

2 Answers

Giulio Vannini
Giulio Vannini
21,922 Points

Solved with:

using System;
namespace Treehouse.CodeChallenges
{
    public class Program
    {     
        public Func<int, int> Square =  (number) =>
        {
            return number * number;
        };
        public Action<int, Func<int, int>> DisplayResult = (result, function) =>
        {
            Console.WriteLine(function(result));
        };
        static void Main(string[] args)
        {
        }
    }
}
Tojo Alex
PRO
Tojo Alex
Pro Student 13,331 Points

I strongly recommend that you don't show the answer