我需要从.NET 4中使用dynamic关键字声明的对象中获取属性及其值的字典?似乎使用反射这是行不通的.
例:
dynamic s = new ExpandoObject();
s.Path = "/Home";
s.Name = "Home";
// How do I enumerate the Path and Name properties and get their values?
IDictionary<string, object> propertyValues = ???
Run Code Online (Sandbox Code Playgroud)