Lambda expression is a feature of VS2008

and not "a feature of .Net Fx 3.0+"

the following code can be successfully compiled when targeting .net Fx 2.0 (and .net CF 2.0 platform as well):

        delegate int MyDelegate(int x, int y);

        
static void Main()
        
{
            MyDelegate myDelegate 
= (x, y) => return x + y; };
            
int result = myDelegate(23);
            Debug.WriteLine(result.ToString());
        }
  

 

Because of the csc in VS2008 is for csharp 3   :-)

enjoy!

 

Freesc

 

posted on 2008-07-24 22:14  J.D Huang  阅读(263)  评论(0编辑  收藏  举报