示例#1
0
        async Task <FetchRowsResult> GetIssuesAsync(FetchPageAsyncArgs args)
        {
            var issues = await IssuesService.GetIssuesAsync(
                page : args.Skip / args.Take,
                pageSize : args.Take,
                sortOrder : GetIssueSortOrder(args.SortOrder),
                filter : (IssueFilter)args.Filter);

            return(new FetchRowsResult(issues, hasMoreRows: issues.Length == args.Take));
        }
示例#2
0
        static async Task <object[]> GetTotalSummariesAsync(GetSummariesAsyncArgs e)
        {
            var summaryValues = await IssuesService.GetSummariesAsync((IssueFilter)e.Filter);

            return(e.Summaries.Select(x => {
                if (x.SummaryType == SummaryType.Count)
                {
                    return (object)summaryValues.Count;
                }
                if (x.SummaryType == SummaryType.Max && x.PropertyName == "Created")
                {
                    return summaryValues.LastCreated;
                }
                throw new InvalidOperationException();
            }).ToArray());
        }