public static string Method1( this string data, Method1Func Handler1 = null, string n = null ) { if (n == null) { Console.WriteLine("n is null"); } else { Console.WriteLine("n is not null"); } Console.WriteLine("Method1: " + data); if (Handler1 != null) { var y = Handler1(data + " from clr"); Console.WriteLine("y: " + y); } return("!"); }
public static string Method1( this string data, Method1Func Handler1 = null, string n = null ) { if (n == null) Console.WriteLine("n is null"); else Console.WriteLine("n is not null"); Console.WriteLine("Method1: " + data); if (Handler1 != null) { var y = Handler1(data + " from clr"); Console.WriteLine("y: " + y); } return "!"; }