Ejemplo n.º 1
0
        static async Task <object[]> GetTotalSummaries(GetSummariesAsyncEventArgs e, Task <List <IssueData> > getSourceTask)
        {
            if (e.Summaries.Single().SummaryType != SummaryType.Count)
            {
                throw new NotImplementedException();
            }
            var data  = await getSourceTask;
            var count = await Task.Run(() => data.Where(MakeFilterPredicate(e.Filter)).Count());

            return(new object[] { count });
        }
Ejemplo n.º 2
0
        async Task <object[]> GetTotalSummariesAsync(GetSummariesAsyncEventArgs e)
        {
            IssueFilter filter        = IssuesHelper.MakeIssueFilter(e.Filter);
            var         summaryValues = await IssuesService.GetSummariesAsync(filter);

            return(e.Summaries.Select(x => {
                if (x.SummaryType == SummaryType.Count)
                {
                    return (object)summaryValues.Count;
                }
                throw new InvalidOperationException();
            }).ToArray());
        }
        static async Task <object[]> GetTotalSummariesAsync(GetSummariesAsyncEventArgs e)
        {
            IssueFilter filter        = MakeIssueFilter(e.Filter);
            var         summaryValues = await IssuesService.GetSummariesAsync(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());
        }