We have a project which both uses ServiceStack.Text and Newtonsoft.json. Now I want to migrate everything to yours. One class I have no clue, it has extension methods on Newtonsoft’s method JsonTextWriter, example:
public static void Write(this JsonTextWriter jsonWriter, Overlay overlay)
{
ArgumentValidator.IsNotNull(jsonWriter, nameof(jsonWriter));
if (overlay != null)
{
jsonWriter.WriteStartObject();
jsonWriter.WritePropertyName("uniqueid");
jsonWriter.WriteValue(overlay.Id.Value);
jsonWriter.WritePropertyName("metaType");
jsonWriter.WriteValue(overlay.Type.ToString().ToLower());
jsonWriter.WritePropertyName("title");
jsonWriter.WriteValue(overlay.Title);
if (overlay is MarkerOverlay)
{
jsonWriter.Write(overlay as MarkerOverlay);
}
else if (overlay is PolylineOverlay)
{
jsonWriter.Write(overlay as PolylineOverlay);
}
else if (overlay is PolygonOverlay)
{
jsonWriter.Write(overlay as PolygonOverlay);
}
jsonWriter.WriteEndObject();
}
else
{
jsonWriter.WriteNull();
}
}
And of course the derived classes have again their specific writers.
What would be a ServiceStack implementation?