扩展方法

public delegate int Mydg(int a ,int b);

public static class LambdaTest

{

public static int Oper(this int a ,int b ,Mydg dg)

{

return dg(a,b)

}

}

 

Console.WriteLine(1.Oper(2,(a,b)=>a+b));

posted @ 2015-01-11 12:11  xjt360  阅读(126)  评论(0编辑  收藏  举报