如何反映動態(tài)對象的成員?我需要從.NET 4中使用Dynamic關(guān)鍵字聲明的對象中獲得屬性及其值的字典?似乎使用反射是行不通的。例子: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條經(jīng)驗 獲得超5個贊
ExpandoObject
DynamicObject
GetDynamicMemberNames
IDynamicMetaObjectProvider
GetDynamicMemberNames
is IDynamicMetaObjectProvider
.
- 3 回答
- 0 關(guān)注
- 471 瀏覽
添加回答
舉報
0/150
提交
取消