Skip to content

Instantly share code, notes, and snippets.

View haldiggs's full-sized avatar

H Diggs haldiggs

  • Fort Worth, Texas
View GitHub Profile
@haldiggs
haldiggs / MyEmberJsonMediaTypeFormatter.cs
Created February 9, 2016 22:08 — forked from eibrahim/MyEmberJsonMediaTypeFormatter.cs
A JSON formatter for ASP.NET Web API to support Ember Data
public class MyEmberJsonMediaTypeFormatter : JsonMediaTypeFormatter
{
private int _maxDepth = 256;
private JsonSerializerSettings _jsonSerializerSettings;
public MyEmberJsonMediaTypeFormatter()
{
_jsonSerializerSettings = CreateDefaultSerializerSettings();
}
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)
{