Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 0151ca3be1
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (19 sloc) 0.615 kB
using System.ServiceModel.Syndication;
using System.Web.Mvc;
using System.Xml;
namespace WP_ITN_RSS
{
public class RssActionResult : ActionResult
{
public SyndicationFeed Feed { get; set; }
public override void ExecuteResult(ControllerContext context)
{
context.HttpContext.Response.ContentType = "application/rss+xml";
var rssFormatter = new Rss20FeedFormatter(Feed);
using (XmlWriter writer = XmlWriter.Create(context.HttpContext.Response.Output))
{
rssFormatter.WriteTo(writer);
}
}
}
}
Jump to Line
Something went wrong with that request. Please try again.