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

后端 未结 2 1864
悲哀的现实
悲哀的现实 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.

    0 讨论(0)
  • 2021-01-14 09:02

    Should be fixed as of https://github.com/ServiceStack/ServiceStack.Text/pull/347 decimals will come back by default unless you specify TryToParseNumericType in which case you'll get the best fitting number type.

    0 讨论(0)
提交回复
热议问题