April 2008
Intermediate to advanced
704 pages
17h 49m
English
Problem
You need to use an inline function, which is a single-line function that does not require a standard function code block, in an effort to save some development time or support LINQ (discussed in more detail in Chapter 6).
Solution
Create a lambda expression using the Function keyword, and use it directly or pass it as an argument to a function that requires a delegate.
How It Works
To use a simple function, you typically start by creating the function. The following example takes an Integer and multiplies it by itself:
Private Shared Function Square(ByVal num As Integer) As Integer
Return num * num
End Function
If you need to pass a function as an argument to some method, you could use a delegate ...
Read now
Unlock full access