Exemplo n.º 1
0
        public listView <Entity> ListTemplates(string version, QueryDisplayParams query)
        {
            DisableCaching();
            var result = new listView <Entity>();

            try
            {
                result.page = new pager <Entity>();
                var service = new RosterDataService();
                var content = service.ListTemplates().ToList();
                result.total = content.Count();
                content.Take(query.currentPageSize).Skip(query.currentPageNum * query.currentPageSize).ToList().ForEach(item =>
                {
                    result.page.pageItems.Add(new Entity
                    {
                        Key    = item.FindValue("Id").ToSafeString(),
                        Fields = item.ExpandoToNamed()
                    });
                });
            }
            catch (Exception ex)
            {
                //HandleException(ex);
            }
            return(result);
        }