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 trial

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
229,645 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.