Exemplo n.º 1
0
        public Tournoi GetTournament([FromQuery] int id)
        {
            var t = DB_CURD.GetTournament(id);

            Tournoi retour = new()
            {
                IdTournament    = t.IdTournament,
                Name            = t.Name,
                Date            = t.Date,
                Description     = t.Description,
                jeu             = DB_CURD.GetJeu(t.IdGame),
                Dotation        = DB_CURD.GetDotationsOf(t.IdTournament),
                Resultas        = DB_CURD.GetResultasOfTournament(t.IdTournament),
                Participants    = DB_CURD.GetParticipantsOf(t.IdTournament),
                Organisateurs   = DB_CURD.GetOrgasOf(t.IdTournament),
                DeckListNumber  = t.DeckListNumber,
                MaxNumberPlayer = t.MaxNumberPlayer,
                Ppwin           = t.Ppwin,
                Ppdraw          = t.Ppdraw,
                Pplose          = t.Pplose,
                Over            = t.Over,
                Deleted         = t.Deleted,
                Matchs          = GetMatchsOfTournament(t.IdTournament),
                Rounds          = GetRoundsOfTournament(t.IdTournament)
            };

            if (retour.Over)
            {
                retour.Resultas = DB_CURD.GetResultasOfTournament(retour.IdTournament);
            }
            if (retour.Deleted == null)
            {
                var c = DB_CURD.GetScoreClassementTemporairesOfTournamnent(retour.IdTournament);
                retour.Classement = c.Any() ? c : null;
            }

            return(retour);
        }