Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BasicTournamentDTO"/> class.
        /// </summary>
        /// <param name="tournamentInfo">The <see cref="tournament"/> used for creating instance</param>
        internal BasicTournamentDTO(tournamentInfoEndpoint tournamentInfo)
            : base(new sportEvent
        {
            id                     = tournamentInfo.tournament.id,
            name                   = tournamentInfo.tournament.name,
            scheduled              = tournamentInfo.tournament.scheduled,
            scheduledSpecified     = tournamentInfo.tournament.scheduledSpecified,
            scheduled_end          = tournamentInfo.tournament.scheduled_end,
            scheduled_endSpecified = tournamentInfo.tournament.scheduled_endSpecified,
            tournament             = tournamentInfo.tournament,
            type                   = null
        })
        {
            Guard.Argument(tournamentInfo, nameof(tournamentInfo)).NotNull();

            TournamentCoverage = new TournamentCoverageDTO(tournamentInfo.coverage_info);
            Category           = tournamentInfo.tournament.category == null
                ? null
                : URN.Parse(tournamentInfo.tournament.category.id);
            Competitors = tournamentInfo.competitors.Select(s => new CompetitorDTO(s));
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BasicTournamentDTO"/> class.
        /// </summary>
        /// <param name="tournamentInfo">The <see cref="tournament"/> used for creating instance</param>
        internal BasicTournamentDTO(tournamentInfoEndpoint tournamentInfo)
            : base(new sportEvent
        {
            id                     = tournamentInfo.tournament.id,
            name                   = tournamentInfo.tournament.name,
            scheduled              = tournamentInfo.tournament.scheduled,
            scheduledSpecified     = tournamentInfo.tournament.scheduledSpecified,
            scheduled_end          = tournamentInfo.tournament.scheduled_end,
            scheduled_endSpecified = tournamentInfo.tournament.scheduled_endSpecified,
            tournament             = tournamentInfo.tournament,
            type                   = null
        })
        {
            Contract.Requires(tournamentInfo != null);

            TournamentCoverage = new TournamentCoverageDTO(tournamentInfo.coverage_info);
            Category           = tournamentInfo.tournament.category == null
                ? null
                : URN.Parse(tournamentInfo.tournament.category.id);
            Competitors = tournamentInfo.competitors.Select(s => new CompetitorDTO(s));
        }