コード例 #1
0
        public DreamMessage GetFeedEntry(string title, string date)
        {
            var entryDoc = (from entry in LoadFeed()["entry"]
                            let pathInfo = EntryHelper.GetPathInfo(entry)
                                           where pathInfo.Title == title && pathInfo.Date == date
                                           select entry).FirstOrDefault();

            return(entryDoc == null?DreamMessage.NotFound("no such entry") : DreamMessage.Ok(entryDoc));
        }
コード例 #2
0
        //--- Methods ---
        public ActionResult Index()
        {
            _log.Debug("Getting feed index");
            var feed  = FeedService.Get().ToDocument();
            var posts = from entry in feed["entry"]
                        let pathInfo = EntryHelper.GetPathInfo(entry)
                                       select new PostModel()
            {
                Title     = entry["title"].AsText,
                Summary   = entry["summary"].AsText,
                PathDate  = pathInfo.Date,
                PathTitle = pathInfo.Title
            };

            return(View(posts.ToArray()));
        }