コード例 #1
0
        public async static Task <PagedList <Device> > FindAllAsync(string query = null, IEnumerable <string> fields = null, int page = 1, int pageSize = 20, string orderBy = null, SortOrder sortOrder = SortOrder.Descending)
        {
            var articles = await Articles.FindAllAsync("device", query, fields, page, pageSize, orderBy, sortOrder);

            var devices = articles.Select(x => new Device(x));
            var list    = new PagedList <Device>()
            {
                PageNumber   = articles.PageNumber,
                PageSize     = articles.PageSize,
                TotalRecords = articles.TotalRecords,
                GetNextPage  = async skip => await FindAllAsync(query, fields, page + skip + 1, pageSize, orderBy, sortOrder)
            };

            list.AddRange(devices);
            return(list);
        }
コード例 #2
0
 public async Task <PagedList <Connection> > GetConnectionsAsync(string relation, string query = null, string label = null, IEnumerable <string> fields = null, int pageNumber = 1, int pageSize = 20)
 {
     return(await Articles.GetConnectionsAsync(relation, this.Id, query, label, fields, pageNumber, pageSize));
 }