Ejemplo n.º 1
0
        /// <inheritdoc />
        public virtual ContentListViewModel CreateListViewModelByParent(SfBlog parentItem, int page)
        {
            if (page < 1)
                throw new ArgumentException("'page' argument has to be at least 1.", "page");

            var query = ((BlogsManager)this.GetManager()).GetBlogPosts().Where(bp => bp.Parent.Id == parentItem.Id);
            if (query == null)
                return this.CreateListViewModelInstance();

            var viewModel = this.CreateListViewModelInstance();
            this.PopulateListViewModel(page, query, viewModel);

            return viewModel;
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public virtual ContentListViewModel CreateListViewModelByParent(SfBlog parentItem, int page)
        {
            if (page < 1)
            {
                throw new ArgumentException("'page' argument has to be at least 1.", "page");
            }

            var query = ((BlogsManager)this.GetManager()).GetBlogPosts().Where(bp => bp.Parent.Id == parentItem.Id);

            if (query == null)
            {
                return(this.CreateListViewModelInstance());
            }

            var viewModel = this.CreateListViewModelInstance();

            this.PopulateListViewModel(page, query, viewModel);

            return(viewModel);
        }