public override Task WriteToStreamAsync(Type type, object value, Stream writeStream, System.Net.Http.HttpContent content, System.Net.TransportContext transportContext) { RssFeedBuilder builder; if (typeisIRss(type)) builder = new RssFeedBuilder((IRss)value); else builder = new RssFeedBuilder((IEnumerable<IRss>)value); builder.BuildSyndicationFeed(writeStream, content.Headers.ContentType.MediaType); return Task.FromResult(0); }
public override Task WriteToStreamAsync(Type type, object value, Stream writeStream, System.Net.Http.HttpContent content, System.Net.TransportContext transportContext) { RssFeedBuilder builder; if (typeisIRss(type)) { builder = new RssFeedBuilder((IRss)value); } else { builder = new RssFeedBuilder((IEnumerable <IRss>)value); } builder.BuildSyndicationFeed(writeStream, content.Headers.ContentType.MediaType); return(Task.FromResult(0)); }