如何反映动态对象的成员?我需要从.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 = ???
3 回答
沧海一幻觉
TA贡献1824条经验 获得超5个赞
ExpandoObject
DynamicObject
GetDynamicMemberNames
IDynamicMetaObjectProvider
GetDynamicMemberNames
is IDynamicMetaObjectProvider
.
- 3 回答
- 0 关注
- 453 浏览
添加回答
举报
0/150
提交
取消