经典款
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));
经典款
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));