Created
March 20, 2013 18:48
-
-
Save techniq/5207344 to your computer and use it in GitHub Desktop.
Example using an anonymous object to pass in key/value options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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