[.NET] Linq et type dynamique, attention au piège en .NET

Problème Le code suivant affiche « Numbers greater than 3 are : 6 7 » au lieu du « Numbers greater than 3 are : 4 5 6 7 » attendu. Savez-vous pourquoi ? class Program { static void Main(string[] args) { List<Int32> allNumbers = new List<Int32>() { 1, 2, 3, 4, 5, 6, 7 }; List<dynamic> greaterNumbers = new List<dynamic>(); // Finding all numbers from the "allNumbers" list that are greater // than "currentNumber" for (Int32 currentNumber = 0; currentNumber < 5; currentNumber++) { dynamic item = new ExpandoObject(); item. [Voir plus]