Exemple #1
0
        public IActionResult GenerateFixtures(Guid competitionId)
        {
            var competition = GetById(competitionId);

            if (competition == null)
            {
                return(BadRequest());
            }

            var teams    = Context.CompetitionsTeams.Where(o => o.Competition == competition).Select(c => c.Team).ToList();
            var fixtures = FixtureHelper.CreateRandomFixtures(teams, competition.IsTwoLeggedTie);

            return(Ok(fixtures));
        }