Is it possible in c # to create a generic lambda, for example

static void Main() { Console.WriteLine(Fun(x => x * x, x => x + x, 3)); Func<Func<int, int>, Func<int, int>, int, int> fun = (a, b, x) => a(b(x)); Console.WriteLine(fun(x => x * x, x => x + x, 3)); } static T Fun<T>(Func<T, T> a, Func<T, T> b,T x) { return a(b(x)); } 

There is a Fun function, and it is generalized, but is it possible to do the same with a lambda, for example, once I want to call a lambda fun with an int type, and another time with a double type

Thank you in advance

    1 answer 1

    No, they cannot define their own generic parameters.