public static List <EditablePost> GetEditablePosts(bool actualizeDates = false) { List <EditablePost> posts = (List <EditablePost>)HttpContext.Current.Session["Posts"]; if (posts == null) { posts = EditablePostProvider.Posts().ToList(); var postLookups = posts.Select(p => new PostLookup(p.PostID, p.From)); foreach (EditablePost post in posts) { IEnumerable <PostLookup> filteredPostLookups = postLookups.Where(l => l.PostId != post.PostID); post.PostLookups.AddRange(filteredPostLookups); } if (actualizeDates) { ActualizeDates(posts); } HttpContext.Current.Session["Posts"] = posts; } return(posts); }
public static EditablePost GetPostByID(int id) { return(EditablePostProvider.Posts().SingleOrDefault(p => p.PostID == id)); }
public static IEnumerable GetChildPosts(int id) { return(EditablePostProvider.Posts().Where(p => p.ParentID == id)); }
public static IEnumerable GetPosts() { return(EditablePostProvider.Posts()); }