Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PostQueries postRepository = new PostQueries(Config.GetLog());
            var         posts          = postRepository.FindLastXPosts(10);

            repLatestPosts.DataSource = posts;
            repLatestPosts.DataBind();
        }
Exemplo n.º 2
0
        private void BindPost()
        {
            PostQueries postRepository = new PostQueries(Config.GetLog());
            int         postId         = this.GetCurrentPostId();

            MyBlog.Reporting.Projections.DTOPost post = postRepository.FindById(postId);

            this.litPublishDate.Text  = Utils.FormatDate(post.PublishDate.Value);
            this.litSubject.Text      = Utils.FormatText(post.Subject);
            this.litBody.Text         = Utils.FormatText(post.Body);
            this.litCommentCount.Text = post.Comments.Count().ToString();
            this.litCategories.Text   = FormatCategories(post.Categories);

            //Up to the page to decide how to order the comments
            this.repReplies.DataSource = post.Comments.OrderBy(c => c.CreationDate);
            this.repReplies.DataBind();

            pnlReply.Visible = post.CommentsEnabled;
        }
Exemplo n.º 3
0
		public TagController(TagQueries tagQueries, PostQueries postQueries)
		{
			_tagQueries = tagQueries;
			_postQueries = postQueries;
		}
Exemplo n.º 4
0
 public Query(UserQueries userQueries, PostQueries postQueries)
 {
     _userQueries = userQueries;
     _postQueries = postQueries;
 }
Exemplo n.º 5
0
		public CategoryController(CategoryQueries categoryQueries, PostQueries postQueries)
		{
			_categoryQueries = categoryQueries;
			_postQueries = postQueries;
		}
Exemplo n.º 6
0
		public PostListingController(PostQueries postQueries)
		{
			_postQueries = postQueries;
		}
Exemplo n.º 7
0
		public PostController(PostQueries postQueries, UserQueries userQueries)
		{
			_postQueries = postQueries;
			_userQueries = userQueries;
		}