Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
If you want to use Lambda Expression as reusable function, you need to use Func. By using the Func we are actually calling in-build delegate.
So if you write
Dim sqr As Func(Of Double, Double) = Function(x) x * x
Then you can use it in you application to get the square of a number.
Console.WriteLine(sqr(2))
Console.WriteLine(sqr(8))
This could be used in multiple places with different parameter as you generally do with any function.
Namoskar!!!