Example #1
0
        public virtual ActionResult GridDataSource(DataManager dm)
        {
            var query = _pagesService.GetAsQueryable();

            var dataSource = query.Select(p => new
            {
                p.Id,
                p.Slug,
                p.Title,
                p.ShowInPanel,
                p.PanelTitle,
                p.Published
            });

            var result = dataSource.ApplyDataManager(dm, out var count).ToList();

            return(Json(dm.RequiresCounts ? new { result = result, count = count } : (object)result,
                        JsonRequestBehavior.AllowGet));
        }