I\'m trying to write a simple object to Dictionary converter like below:
public static class SimplePropertyDictionaryExtensionMethods
{
public static IDi
Remove BindingFlags.GetProperty
This is used to get a property value when using InvokeMember, it does not specify that you want a read only property returned.
EDIT: The problem may actually be with the propertyInfo.GetGetMethod() - Try using one of the following (I have only ever used the first one):
var value = propertyInfo.GetValue(input, null);
var value = propertyInfo.GetGetMethod().Invoke(input, null);