문제

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