Skip to content

Instantly share code, notes, and snippets.

@okaram
Created February 18, 2015 01:55
Show Gist options
  • Save okaram/ad9eab5e4e0bacf83ec1 to your computer and use it in GitHub Desktop.
Save okaram/ad9eab5e4e0bacf83ec1 to your computer and use it in GitHub Desktop.
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;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment