public PostSummary(Post post, Documents.Blog blog, int index, int total) { this.post = post; this.blog = blog; this.index = index + 1; // not zero indexed from users perspective this.total = total; }
public PartialViewResult Post(Post post) { if (post == null || post.Id == null) { // figure out what post we are on if (!RouteData.Values.ContainsKey("SourceUrl") || RouteData.Values["SourceUrl"] == null) return PartialView("Invalid"); var source = RouteData.Values["SourceUrl"].ToString(); post = blogManager.Match(source); if (post == null) return PartialView("Invalid"); } return PartialView(post.ToViewModel(blogManager.Settings)); }
public PostBody(Post post, Documents.Blog blog) { this.post = post; this.blog = blog; }
public void AddPost(Post post) { Children.Add(new PostNode(post)); }
public PostNode(Post post) : this() { Id = post.Id; Name = post.Name; }
public Post Create(string name) { var post = new Post {Title = string.Empty, Url = string.Empty, Name = name, Created = DateTime.UtcNow }; session.Store(post); session.SaveChanges(); return post; }