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

Huey Shepard
Huey Shepard
Pro Student 1,430 Points

I'm having problems with Linq question 2. What am I doing wrong. My answer compiles in Visual Studio.

Challenge Task 2 of 3

Create a public Action field named DisplayResult that takes an int parameter and a Func<int, int> parameter. Initialize it with an anonymous method delegate that takes an int result parameter, and a Func<int, int> named operation.

-----------------------------------------Code from Program.css---------------------------------- using System;

namespace Treehouse.CodeChallenges { public class Program {

  public Action<int, Func<int, int>> DisplayResult  = delegate (int result, Func<int, int> operation){};  


1 Answer

Steven Parker
Steven Parker
182,615 Points

It looks like the task 1 code is missing.

In task 1, you created a field named Square, but I don't see it in the code above. In multi-task challenges, each new task must be added to the code created for the previous task(s).

Otherwise, the code you're adding for task 2 looks good.