public delegate int MyDelegate(int x);
public delegate void MyDelegate2(int x,string prefix);
public delegate bool ExprDelegate(int x);
public static void Main()
MyDelegate foo =(x) => x*x;
Console.WriteLine("the result of foo is :{0} ",foo(5));
Console.WriteLine("the result of foo is :{0} ",foo(5));
MyDelegate2 bar = (x,y) =>
Console.WriteLine("Two Arg Lambda: {1} ,{0} ",x *10 ,y);
ExprDelegate baz = (x) => x>10;
Console.WriteLine("Calling baz with 5 : {0} ",baz(5));
Console.WriteLine("Calling baz with 5 : {0} ",baz(15));