1
如何設置/獲取動態對象的屬性'object'?名爲'object'的動態訪問屬性
dynamic json = new ExpandoObject();
json.foo = "bar"; // OK
json.object = "content"; // Does not compile
json["object"] = "content"; // throw RuntimeBinderException
((IDictionary<string, object>)json)["object"] = "content"; // OK, but ...
我想訪問一個REST api,那需要我設置一個名爲'object'的屬性。最後的解決方案實際上解決了這個問題,但我覺得我錯過了一些東西。