/// <summary> /// Initializes a new instance of the <see cref="CurrentSeasonInfoDTO"/> class /// </summary> /// <param name="season">The season</param> public CurrentSeasonInfoDTO(SeasonDTO season) : base(season.Id.ToString(), season.Name) { Year = season.Year; StartDate = season.StartDate; EndDate = season.EndDate; }
/// <summary> /// Initializes a new instance of the <see cref="MatchDTO"/> class /// </summary> /// <param name="matchSummary">A <see cref="matchSummaryEndpoint"/> instance containing basic information about the sport event</param> internal MatchDTO(matchSummaryEndpoint matchSummary) : base(matchSummary) { Guard.Argument(matchSummary, nameof(matchSummary)).NotNull(); if (matchSummary.sport_event.season != null) { Guard.Argument(matchSummary.sport_event.season.id, nameof(matchSummary.sport_event.season.id)).NotNull().NotEmpty(); Guard.Argument(matchSummary.sport_event.season.name, nameof(matchSummary.sport_event.season.name)).NotNull().NotEmpty(); Season = new SeasonDTO(matchSummary.sport_event.season); } if (matchSummary.sport_event.tournament_round != null) { Round = new RoundDTO(matchSummary.sport_event.tournament_round); } if (matchSummary.sport_event.tournament != null) { Guard.Argument(matchSummary.sport_event.tournament.id, nameof(matchSummary.sport_event.tournament.id)).NotNull().NotEmpty(); Guard.Argument(matchSummary.sport_event.tournament.name, nameof(matchSummary.sport_event.tournament.name)).NotNull().NotEmpty(); Tournament = new TournamentDTO(matchSummary.sport_event.tournament); } if (matchSummary.coverage_info != null) { Coverage = new CoverageInfoDTO(matchSummary.coverage_info); } }
/// <summary> /// Initializes a new instance of the <see cref="MatchDTO"/> class /// </summary> /// <param name="sportEvent">A <see cref="sportEvent"/> instance containing basic information about the sport event</param> internal MatchDTO(sportEvent sportEvent) : base(sportEvent) { Guard.Argument(sportEvent, nameof(sportEvent)).NotNull(); if (sportEvent.season != null) { Season = new SeasonDTO(sportEvent.season); } if (sportEvent.tournament_round != null) { Round = new RoundDTO(sportEvent.tournament_round); } if (sportEvent.tournament != null) { Guard.Argument(sportEvent.tournament.id, nameof(sportEvent.tournament.id)).NotNull().NotEmpty(); Guard.Argument(sportEvent.tournament.name, nameof(sportEvent.tournament.name)).NotNull().NotEmpty(); Tournament = new TournamentDTO(sportEvent.tournament); } }
/// <summary> /// Initializes a new instance of the <see cref="TournamentDTO"/> class /// </summary> /// <param name="season">A <see cref="SeasonDTO"/> containing basic tournament info</param> internal TournamentInfoDTO(SeasonDTO season) : base(new sportEvent { id = season.Id.ToString(), name = season.Name, scheduledSpecified = true, scheduled = season.StartDate, scheduled_endSpecified = true, scheduled_end = season.EndDate }) { TournamentCoverage = null; Category = null; Sport = null; Competitors = null; CurrentSeason = null; Season = null; SeasonCoverage = null; Groups = null; Schedule = null; CurrentRound = null; Year = season.Year; TournamentInfo = null; //TODO: missing year, tournamentInfo }