Lambda速学

经典款

1             Func<int, int> jia = x => x + 2;
2 MessageBox.Show(jia(3).ToString());

 

加长款

1             Func<int, string> jia2 = x =>
2 {
3 int i = 10;
4 return (x + 2 + i).ToString();
5 };
6 MessageBox.Show(jia2(3));



posted @ 2011-12-16 13:26  my36z  阅读(176)  评论(0编辑  收藏  举报