Вопрос

We are just starting to develop our new API client using ASP.net Web Api. Having found ServiceStack.Text i do not want to use JSON.NET serialization feature but replace them with ServiceStack. How to set this serializer as default in Web Api? Thanks a lot!

Это было полезно?

Решение

You can create a custom MediaTypeFormatter which uses ServiceStack's serializer/deserializer. Looks like some folks have already created formatter for this here: https://github.com/WebApiContrib/WebAPIContrib/wiki/Media-Type-Formatters

To make it as a default formatter, just insert this new custom formatter in the beginning of the global configuration's formatters list.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top