Skip to content

Instantly share code, notes, and snippets.

@DaveVdE
Created August 22, 2012 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DaveVdE/3428304 to your computer and use it in GitHub Desktop.
Save DaveVdE/3428304 to your computer and use it in GitHub Desktop.
MyJsonMediaTypeFormatter
public class MyJsonMediaTypeFormatter : JsonMediaTypeFormatter
{
public override System.Threading.Tasks.Task WriteToStreamAsync(System.Type type, object value, System.IO.Stream writeStream, System.Net.Http.HttpContent content, System.Net.TransportContext transportContext)
{
var obj = new {d = value};
return base.WriteToStreamAsync(type, obj, writeStream, content, transportContext);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment