Example #1
0
 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;
 }
Example #2
0
        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));
        }
Example #3
0
 public PostBody(Post post, Documents.Blog blog)
 {
     this.post = post;
     this.blog = blog;
 }
Example #4
0
 public void AddPost(Post post)
 {
     Children.Add(new PostNode(post));
 }
Example #5
0
 public PostNode(Post post)
     : this()
 {
     Id = post.Id;
     Name = post.Name;
 }
Example #6
0
        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;
        }