fork(4) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. var Employee1 = new { ID = 5, Name = "Prashant" };
  8. var Employee2 = new { ID = 1, Name = "Tim" };
  9. var employees = new[] { Employee1, Employee2 };
  10.  
  11. foreach (var employee in employees)
  12. {
  13. Console.WriteLine("ID:{0}, Name:{1}", employee.ID, employee.Name);
  14. }
  15. }
  16. }
Success #stdin #stdout 0.04s 33952KB
stdin
Standard input is empty
stdout
ID:5, Name:Prashant
ID:1, Name:Tim