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)); }
//--- 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())); }