How to get ServiceStack to serialize / deserialize an expando object with correct types

后端 未结 2 1863
悲哀的现实
悲哀的现实 2021-01-14 08:23

just trying to work out how well servicestack.text supports serializing expando objects to and from json. I know that an expando object implements an IDictionary. When I s

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-14 08:55

    The ServiceStack.Text on NuGet is a .NET 3.5 dll and has no implicit support for Dynamic/Expando. You can still use the JsonObject to dynamically parse JSON.

    In a .NET 4.0 build of ServiceStack.Text you can use DynamicJson which wraps access to a JSON object in a Dynamic class.

提交回复
热议问题