public async Task <IActionResult> GetRepositoryStats(string repositoryName) { RepoStats stats; try { stats = await _githubService.GetRepositoryStatsAsync(repositoryName); } catch (Exception e) { _logger.LogError(e, "Error retrieving statistics for GitHub repository '{Repository}'", repositoryName); return(new StatusCodeResult(500)); } return(Ok(new { Stats = stats })); }