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