在运行时编译服务器端动态对象时,我真的很喜欢ExpandoObject,但是在JSON序列化过程中我无法将其展平。首先,我实例化对象:dynamicexpando=newExpandoObject();vard=expandoasIDictionary;expando.Add("SomeProp",SomeValueOrClass);到目前为止一切顺利。在我的MVCController中,我想将它作为JsonResult发送下来,所以我这样做:returnnewJsonResult(expando);这会将JSON序列化为以下内容,供浏览器使用:[{"Key":"SomeProp","