Example #1
0
        public async Task Run()
        {
            var people = await _personProvider.LoadPeople();

            if (people == null)
            {
                Console.WriteLine("No data available.");
                return;
            }

            var filteredData = _aggregationService.Aggregate(
                people,
                owner => owner.Gender,
                pet => pet.Type == PetType.Cat,
                pet => pet.Name
                );

            foreach (var entry in filteredData)
            {
                Console.WriteLine(entry.Key);
                foreach (var pet in entry.Value.OrderBy(p => p))
                {
                    Console.WriteLine($"  * {pet}");
                }
            }
        }
        public async Task <Dictionary <int, double> > Get()
        {
            var input  = Enumerable.Range(0, 200000).Select(s => Build());
            var sw     = Stopwatch.StartNew();
            var result = await aggregated.Aggregate(input, CancellationToken.None);

            sw.Stop();
            return(result);
        }
Example #3
0
 public async Task <IActionResult> Aggregate()
 {
     return(Ok(await _aggregationService.Aggregate()));
 }