Skip to content

Instantly share code, notes, and snippets.

@lmatt-bit
Created April 8, 2014 11:22
Show Gist options
  • Select an option

  • Save lmatt-bit/10111431 to your computer and use it in GitHub Desktop.

Select an option

Save lmatt-bit/10111431 to your computer and use it in GitHub Desktop.
Get all members for a class
Test instance = new Test();
Type type = typeof(Test);
Dictionary<string, object> properties = new Dictionary<string, object>();
foreach (PropertyInfo prop in type.GetProperties())
properties.Add(prop.Name, prop.GetValue(instance));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment