Ejemplo n.º 1
0
        public Tournament GetByID(int id)
        {
            var tournament = _tournamentRepository.GetById(id);

            tournament.FederationPaticipate = _federationRepository.GetFederationInTournament(id);
            tournament.Rounds            = _roundRepository.GetListRoundByTournament(id);
            tournament.ChildenTournament = _tournamentRepository.GetAllChildTournament(id);

            if (tournament.ChildenTournament != null && tournament.ChildenTournament.Count() != 0)
            {
                tournament.ChildenTournament = GetStatisticPlayerInChildTour(tournament.ChildenTournament);
            }
            else
            {
                tournament.StatisticPlayer = _playerRepository.GetListPlayerHigherMarkInTournament(id);
            }

            return(tournament);
        }
Ejemplo n.º 2
0
        public Tournament GetById(int id)
        {
            var parameter = new
            {
                Id = id.ToString(),
            };

            using (var objectDb = ObjectDbFactory.CreateInstance("GetSingle"))
            {
                var tournament = objectDb.Query <Tournament, Federation, Tournament>(
                    (tournaments, federation) =>
                {
                    tournaments.Federation = federation;
                    return(tournaments);
                },
                    "FederationID",
                    parameter).FirstOrDefault();

                tournament.FederationPaticipate = _federationRepository.GetFederationInTournament(id);
                tournament.Rounds = _roundRepository.GetListRoundByTournament(id);

                return(tournament);
            }
        }
Ejemplo n.º 3
0
 public IEnumerable <Federation> GetFederationInTournament(int id)
 {
     return(_federationRepository.GetFederationInTournament(id));
 }