Skip to content

Instantly share code, notes, and snippets.

@techniq
Created March 20, 2013 18:48
Show Gist options
  • Select an option

  • Save techniq/5207344 to your computer and use it in GitHub Desktop.

Select an option

Save techniq/5207344 to your computer and use it in GitHub Desktop.
Example using an anonymous object to pass in key/value options
public string Foo(object overrides = null)
{
if (overrides != null)
{
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(overrides))
{
var name = property.Name;
var value = property.GetValue(overrides);
...
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment