Esempio n. 1
0
        public async Task <IActionResult> ResetSeason([FromRoute] short year, [FromRoute] byte season)
        {
            try
            {
                await _teamsService.ResetAllTeamStatsFromSeasonAsync(year, season);

                _logger.LogDebug($"Resetting stats from {year}#{season}.");

                await _matchesService.ResetAllMatchesFromSeasonAsync(year, season);

                _logger.LogDebug($"Resetting matches from {year}#{season}.");

                return(Ok());
            }
            catch (Exception ex)
            {
                _logger.LogError($"Error resetting season {year}#{season}.", ex);
                return(StatusCode(StatusCodes.Status500InternalServerError, $"Error resetting season {year}#{season}."));
            }
        }