You can now target a specific framework in your project. In this function I targeted the 2.0 framework
static void Main(string[] args)
{
var TypedValueList = new List<KeyValuePair<int, int>>();
for (int i = 0; i < 10; i++)
{
for (int x = 0; x < 10; x++)
{
TypedValueList.Add(new KeyValuePair<int, int>(x, i));
}
}
var eList = TypedValueList.FindAll
(pairs => pairs.Key == 0 && pairs.Value > 5).GetEnumerator();
while (eList.MoveNext())
{
Console.WriteLine("\n{0}", eList.Current);
}
Console.ReadKey();
}
And reflector picked up this
private static void Main(string[] args)
{
List<KeyValuePair<int, int>> TypedValueList = new List<KeyValuePair<int, int>>();
for (int i = 0; i < 10; i++)
{
for (int x = 0; x < 10; x++)
{
TypedValueList.Add(new KeyValuePair<int, int>(x, i));
}
}
List<KeyValuePair<int, int>>.Enumerator eList = TypedValueList.FindAll(delegate (KeyValuePair<int, int> pairs) {
return (pairs.Key == 0) && (pairs.Value > 5);
}).GetEnumerator();
while (eList.MoveNext())
{
Console.WriteLine("\n{0}", eList.Current);
}
Console.ReadKey();
}
So it seems that some of the new language features are backwards compatible with older frameworks