Created
September 14, 2011 18:56
-
-
Save howarddierking/1217436 to your computer and use it in GitHub Desktop.
custom media type formatter - skeleton
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyCustomMediaTypeFormatter : MediaTypeFormatter | |
{ | |
public MyCustomMediaTypeFormatter() { | |
SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/vnd.howard.fancyformat")); | |
} | |
protected override object OnReadFromStream(Type type, Stream stream, HttpContentHeaders contentHeaders) { | |
//stuff | |
} | |
protected override void OnWriteToStream(Type type, object value, Stream stream, HttpContentHeaders contentHeaders, TransportContext context) { | |
//stuff | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment