I’ve already written about how to consume RSS or Atom Feeds with the SyndicationFeed (in German, sry) but todays post is about how to create or publish an own feed. Beside the age of the feed standard and the much defamation from Facebook, Twitter and Google on RSS/Atom I consider this easy to consume API as quite handy.
Alright… ASP.NET MVC Infrastructure code: RSS result
The inspiration of the ActionResults came from this blog. The implementation is trivial. All you might need is the reference on System.ServiceModel.
With the ActionResult we are able to return the controller a feed.
The only trap is the URL. Usually the UrlHelper creates only relative links. But with the declaration of all parameters it turns into a proper URL.
If your are looking for the complete example GitHub will be a help like always.