private object RenderPostsByTag(dynamic parameters) { var tag = parameters.tagId; var list = _locator.GetPosts(PathProvider.GetPostsPath(_rootPathProvider)); var posts = new PostListingModel {Tag = tag, Posts = list.Where(l => l.Tags.Select(UrlGenerator.UrlFriendly).ToList().Contains(tag)).ToList()}; return View["Posts", posts]; }
private object RenderPosts(dynamic parameters) { var year = parameters.year; var month = parameters.month; var list = _locator.GetPosts(PathProvider.GetPostsPath(_rootPathProvider)); var posts = new PostListingModel { Year = year, Month = month, Posts = list.Where(i => i.DateCreated.Year.ToString(CultureInfo.InvariantCulture) == year && i.DateCreated.Month.ToString("00") == month).ToList() }; return View["Posts", posts]; }
private object RenderIndex(dynamic parameters) { var list = _locator.GetPosts(PathProvider.GetPostsPath(_rootPathProvider)); var model = new PostListingModel { Posts = list }; return View["Index", model]; }