예제 #1
0
        public async Task <ActionResult <IReadOnlyCollection <Standing> > > GetLongestStandingsAsync(
            [FromRoute] Game game,
            [FromQuery][Required] StandingType standingType,
            [FromQuery] bool?stillOngoing,
            [FromQuery] DateTime?endDate,
            [FromQuery] int?count)
        {
            var standings = await _statisticsProvider
                            .GetLongestStandingsAsync(game, endDate, standingType, stillOngoing)
                            .ConfigureAwait(false);

            return(Ok(standings.Take(count ?? 100).ToList()));
        }
        public async Task <IActionResult> GetLongestStandingAsync(
            [FromRoute] Game game,
            [FromQuery] StandingType standingType,
            [FromQuery] bool?stillOngoing)
        {
            return(await DoAndCatchAsync(
                       LastStandingViewName,
                       standingType.AsPageTitle(stillOngoing == true),
                       async() =>
            {
                var standings = await _statisticsProvider
                                .GetLongestStandingsAsync(game, null, standingType, stillOngoing)
                                .ConfigureAwait(false);

                return new StandingWrViewData
                {
                    TopDetails = standings
                                 .Take(25)
                                 .Select(x => x.ToStandingWrLevelItemData())
                                 .ToList()
                };
            }).ConfigureAwait(false));
        }