示例#1
0
        //
        // GET: /DailyText/

        public ActionResult Index()
        {
            var model     = _dailyTextManager.GetTodaysText();
            var viewModel = new DailyTextViewModel
            {
                DateLine = model.DateLine,
                Header   = model.Header,
                Body     = model.Body
            };

            return(View(viewModel));
        }
示例#2
0
        //
        // GET: /Feed/

        public ActionResult Index()
        {
            var getTodaysText = _dailyTextManager.GetTodaysText();
            var texts         = _dailyTextManager.GetDailyTextList();

            var postItems = texts
                            .Select(p => new SyndicationItem(p.DateLine, GetContent(string.Concat(p.Header, "<br/>", p.Body)), new Uri(string.Format("http://assignit.apphb.com/DailyText/Article/{0}", p.Id))));

            var feed = new SyndicationFeed("Daily Text", "The Daily Text", new Uri("http://assignit.apphb.com/Feed"), postItems)
            {
                Copyright = new TextSyndicationContent("Copyright 2013"),
                Language  = "en-US"
            };

            return(new FeedResult(new Rss20FeedFormatter(feed)));
        }