예제 #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;
 }
예제 #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));
        }
예제 #3
0
파일: PostBody.cs 프로젝트: tuanvt/EyePatch
 public PostBody(Post post, Documents.Blog blog)
 {
     this.post = post;
     this.blog = blog;
 }
예제 #4
0
 public void AddPost(Post post)
 {
     Children.Add(new PostNode(post));
 }
예제 #5
0
파일: PostNode.cs 프로젝트: tuanvt/EyePatch
 public PostNode(Post post)
     : this()
 {
     Id = post.Id;
     Name = post.Name;
 }
예제 #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;
        }