Exemplo n.º 1
0
        public async Task <IActionResult> Get(string leagueCode)
        {
            var competition = await _footballRepository.GetCompetitionWithChildrenAsync(x => x.Code.Equals(leagueCode));

            if (competition == null)
            {
                return(NotFound(new { message = "Not found" }));
            }

            var total = 0;

            competition.CompetitionTeams.ForEach(x => total += x.Team.Players.Count);

            return(Ok(new { total }));
        }