Lambda Expression in C Sharp (C#)
The lambda expression is a shorter way of representing anonymous method using some special syntax.
A lambda expression is an expression of any of the following two forms:
(input-parameters) => expression
(input-parameters) => { <sequence-of-statements> }
Any lambda expression can be converted to a delegate type. The delegate type to which a lambda expression can be converted is defined by the types of its parameters and return value. If a lambda expression doesn't return a value, it can be converted to one of the Action delegate types; otherwise, it can be converted to one of the Func delegate types. For example, a lambda expression that has two parameters and returns no value can be converted to an Action<T1,T2> delegate. A lambda expression that has one parameter and returns a value can be converted to a Func<T,TResult> delegate.