c#3.0表达式的含义()=>
问题描述:
此表达式()=>"的含义是什么.我看过它在构造函数中使用过:
What is the meaning of this expression " () =>". I have seen it used in a constructor:
return new MyItem(itemId, () => MyFunction(myParam));
谢谢
答
这是不带参数的委托,写为lambda.与
It's a delegate without parameters, written as a lambda. Same as:
return new MyItem(itemId, delegate() {return MyFunction(myParam); });