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

余生颓废 提交于 2019-12-01 08:27:11

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.

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!