コード例 #1
0
 private static object TransformList(ApiContext context, ISmartList smartList)
 {
     if (context.Count<smartList.Count)
     {
         //We already get more than allowed, so data is not paged
         context.TotalCount = smartList.Count;
     }
     smartList.TakeCount = context.SpecifiedCount;
     smartList.StartIndex = context.StartIndex;
     smartList.IsDescending = context.SortDescending;
     smartList.SortBy = context.SortBy;
     smartList.FilterBy = context.FilterBy;
     smartList.FilterOp = context.FilterOp;
     smartList.FilterValue = context.FilterValues;
     smartList.UpdatedSince = context.UpdatedSince;
     smartList.FilterType = context.FilterToType;
     return smartList.Transform();
 }
コード例 #2
0
 private static object TransformList(ApiContext context, ISmartList smartList)
 {
     if (context.Count < smartList.Count)
     {
         //We already get more than allowed, so data is not paged
         context.TotalCount = smartList.Count;
     }
     smartList.TakeCount    = context.SpecifiedCount;
     smartList.StartIndex   = context.StartIndex;
     smartList.IsDescending = context.SortDescending;
     smartList.SortBy       = context.SortBy;
     smartList.FilterBy     = context.FilterBy;
     smartList.FilterOp     = context.FilterOp;
     smartList.FilterValue  = context.FilterValues;
     smartList.UpdatedSince = context.UpdatedSince;
     smartList.FilterType   = context.FilterToType;
     return(smartList.Transform());
 }
コード例 #3
0
        private static object TransformList(ApiContext context, ISmartList smartList)
        {
            bool getTotalCount = context.SpecifiedCount < smartList.Count && !context.TotalCount.HasValue;/*We have already more items than needed and no one set totalcount*/

            smartList.TakeCount = context.SpecifiedCount;
            smartList.StartIndex = context.StartIndex;
            smartList.IsDescending = context.SortDescending;
            smartList.SortBy = context.SortBy;
            smartList.FilterBy = context.FilterBy;
            smartList.FilterOp = context.FilterOp;
            smartList.FilterValue = context.FilterValues;
            smartList.UpdatedSince = context.UpdatedSince;
            smartList.FilterType = context.FilterToType;
            var list= smartList.Transform(getTotalCount);
            if (getTotalCount)
            {
                context.TotalCount = smartList.TotalCount;
            }
            return list;
        }
コード例 #4
0
        private static object TransformList(ApiContext context, ISmartList smartList)
        {
            bool getTotalCount = context.SpecifiedCount < smartList.Count && !context.TotalCount.HasValue;/*We have already more items than needed and no one set totalcount*/

            smartList.TakeCount    = context.SpecifiedCount;
            smartList.StartIndex   = context.StartIndex;
            smartList.IsDescending = context.SortDescending;
            smartList.SortBy       = context.SortBy;
            smartList.FilterBy     = context.FilterBy;
            smartList.FilterOp     = context.FilterOp;
            smartList.FilterValue  = context.FilterValues;
            smartList.UpdatedSince = context.UpdatedSince;
            smartList.FilterType   = context.FilterToType;
            var list = smartList.Transform(getTotalCount);

            if (getTotalCount)
            {
                context.TotalCount = smartList.TotalCount;
            }
            return(list);
        }