Lambda expression ( =>) is anonymous function without a declaration.It allow you to write a method in the same place where you required. It is a single line method which return a value.
Advantages:
1. It reduce the line of codes.
2. Inline method , so fast in execution.
3.Does not require write function elsewhere.
But complex definition increase reduce execution speed so lambda expressions are useful for small and simple methods
Example:
List All_Number = new List { 1,2,3,4,5,6,7,8,9,10 };
List Even_Number = All_Number.Where(n => n % 2 == 0).ToList();
foreach (int lt in Even_Number)
{
Console.WriteLine(lt);
}
Output will be:
2
4
6
8
10