It looks like you want to save Funcin a variable for later use. Take a look at the examples here :
using System;
public class GenericFunc
{
public static void Main()
{
Func<string, string> convertMethod = UppercaseString;
string name = "Dakota";
Console.WriteLine(convertMethod(name));
}
private static string UppercaseString(string inputString)
{
return inputString.ToUpper();
}
}
See how the method UppercaseStringis stored in a variable name convertMethod, which can then be called: convertMethod(name).
David source
share