Ejemplo n.º 1
0
        public void OnGet()
        {
            PageIndex = 1;
            if (RouteData.Values.ContainsKey("id"))
            {
                PageIndex = Convert.ToInt32(RouteData.Values["id"]);
            }
            Articles      = articleRepository.Get(PageIndex, pageSize);
            ArticlesCount = articleRepository.ArticlesCount();

            if (ArticlesCount % pageSize == 0)
            {
                PageCount = ArticlesCount / pageSize;
            }
            else
            {
                PageCount = ArticlesCount / pageSize + 1;
            }

            foreach (var item in Articles)
            {
                item.keyWords = new KeyWordRepository().FindsArticle(item.Id);
                item.Author   = new UserRepository().Find(item.Author.Id);
            }
        }