Create a lambda from Func in CSharp
Description
The following code shows how to create a lambda from Func.
Example
/*ww w . j a v a 2s . c o m*/
using System;
class Test {
static void Main() {
Func<int, int> square = x => x * x;
Console.WriteLine(square(3)); // 9
}
}
The code above generates the following result.