fork download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8.  
  9. var objects = new List<dynamic>{
  10. new {Id = 2, Nome = "Wallace"},
  11. new {Id = 2, Nome = "Wallace"},
  12. };
  13.  
  14.  
  15. foreach (var user in objects)
  16. {
  17. Console.WriteLine("Meu id é {0}", user.Id);
  18. Console.WriteLine("Meu nome é {0}", user.Nome);
  19. }
  20. }
  21. }
Success #stdin #stdout 0.52s 30672KB
stdin
Standard input is empty
stdout
Meu id é 2
Meu nome é Wallace
Meu id é 2
Meu nome é Wallace