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(2, 3);
Debug.WriteLine(result.ToString());
}
static void Main()
{
MyDelegate myDelegate = (x, y) => { return x + y; };
int result = myDelegate(2, 3);
Debug.WriteLine(result.ToString());
}
Because of the csc in VS2008 is for csharp 3 :-)
enjoy!
Freesc