Exemple #1
0
 public void Serialize <TModel>(string contentType, TModel model, Stream outputStream)
 {
     JsonSerializer.SerializeToStream(model, outputStream);
 }
Exemple #2
0
        public override Task WriteToStreamAsync(Type type, object value, Stream writeStream, System.Net.Http.HttpContent content, TransportContext transportContext)
        {
            var task = Task.Factory.StartNew(() => JsonSerializer.SerializeToStream(value, type, writeStream));

            return(task);
        }