public RssActionResult RSS() { IList <StoryLink> StoryLinkList = new StoryLink().GetAllStories(); RssActionResult <StoryLink> rss = new RssActionResult <StoryLink>("My Stories", StoryLinkList, e => new XElement("Item", new XAttribute("title", e.Title), new XAttribute("description", e.Description), new XAttribute("link", e.Url) ) ); return(rss); }
public ContentResult XMLContent() { IList <StoryLink> StoryLinkList = new StoryLink().GetAllStories(); XElement data = new XElement("StoryList", StoryLinkList.Select(e => new XElement("Story", new XAttribute("title", e.Title), new XAttribute("description", e.Description), new XAttribute("link", e.Url) ) ) ); return(Content(data.ToString(), "text/xml")); }
/// <summary> /// this method by default defined for HttpPost method for use this method for HttpGet method Set JsonRequestBehavior to AllowGet /// </summary> /// <returns></returns> public JsonResult JsonContent() { IList <StoryLink> StoryLinkList = new StoryLink().GetAllStories(); return(Json(StoryLinkList, JsonRequestBehavior.AllowGet)); }