Esempio n. 1
0
        public AllArticlesForApprovalViewModel GetAllArticlesForApproval()
        {
            var articlesForApproval = this.context.Articles.Where(a => a.IsSentForApproval).Select(a =>
                                                                                                   new ArticleForApprovalListViewModel
            {
                ArticleId = a.Id,
                Title     = a.Title,
                Author    = a.Author.UserName,
                PostedOn  = a.PostDate
            }).OrderBy(a => a.PostedOn).ToList();

            var allArticlesForApproval = new AllArticlesForApprovalViewModel
            {
                Items = articlesForApproval
            };


            allArticlesForApproval.PaginationModel.TotalPages = paginationService.GetTotalPages(allArticlesForApproval.Items.Count());

            return(allArticlesForApproval);
        }