Here\'s my dilemma. I\'m using a RESTful ASP.NET service, trying to get a function to return a JSON string in this format:
{\"Test1Key\":\"Test1Value\",\"Te
avoiding the "__type" in json...
in the webapi.config, there are several options (look to the last one):
// To disable tracing in your application, please comment out or remove the following line of code
// For more information, refer to: http://www.asp.net/web-api
//config.EnableSystemDiagnosticsTracing();
// Use camel case for JSON data.
config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
// The setting will let json.net to save type name in the payload if the runtime type is different with the declare type.
// When you post it back, json.net will deserialize the payload to the type you specified in the payload.
// source: http://stackoverflow.com/questions/12858748/asp-net-webapi-posting-collection-of-subclasses
//config.Formatters.JsonFormatter.SerializerSettings.TypeNameHandling = TypeNameHandling.Objects;