void Main() { Person p=new Person(){Name="Orlando",Age=10}; Console.WriteLine(p.GetType().GetProperties()); Console.WriteLine(p.GetType().GetProperties().Select(x=>x.GetMethod.Invoke(p,null))); } // Define other methods and classes here class Person { public string Name {get; set;} public int Age{get;set;} }