SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 68 | Next

Scott Klein

"Professional LINQ"


Lambda expressions use what is called the lambda operator, which is =>. This operator means ??????goes to,??™??™
and signifies that the left side of the lambda operator specifies any input parameters while the right side
contains the expression or statement block.
Here??™s a simple C# example of a lambda expression:
y => y * 2
This reads as ??????y goes to y times 2.??™??™ The body of a lambda expression can consist of any number of
statements, but typically you want to keep it to two or three, mainly for readability and to keep it from
becoming overly complex. It is also often unnecessary to specify a type for input parameters because
the compiler will infer the type based on several factors, such as the body of the lambda expression and
the underlying delegate type.
To work with lambda expressions, it is best to follow these general rules:
??‘ If the lambda expression returns a value, the return value must be implicitly convertible to the
return type of the delegate.
??‘ Lambda expressions must contain the same number of parameters as the delegate type.


Pages:
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6