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 Functional Programming in C# Lambda Expressions

I am not able to do the second part of this question which is to make Display result a lambda function

I have tried several things but the video does not show how to make a complicated thing like this into a lambda function so I have been guessing. Can someone give me a suggestion on what to do - thanks?

Program.cs
using System;

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

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

        static void Main(string[] args)
        {

        }
    }
}
Steven Parker
Steven Parker
220,513 Points

It doesn't look like you've written any code yet.

What about task 1? You should have made some changes for task 1 if you're on task 2 now.

One reason task 1 is important to complete first is that at least part of task 2 is very similar to task 1. Please at least show your task 1 code and give task 2 a good-faith attempt.