/// <summary> /// Initializes a new instance of the <see cref="SeasonDTO" /> class /// </summary> /// <param name="season">A <see cref="season" /> containing information about a season.</param> internal SeasonDTO(seasonExtended season) : base(season.id, season.name) { Contract.Requires(season != null); Contract.Requires(!string.IsNullOrEmpty(season.year)); StartDate = season.start_date; EndDate = season.end_date; Year = season.year; if (season.start_timeSpecified) { StartDate = SdkInfo.CombineDateAndTime(season.start_date, season.start_time); } if (season.end_timeSpecified) { EndDate = SdkInfo.CombineDateAndTime(season.end_date, season.end_time); } }
/// <summary> /// Initializes a new instance of the <see cref="SeasonDTO"/> class /// </summary> /// <param name="season">A <see cref="season"/> containing information about a season.</param> internal SeasonDTO(seasonExtended season) : base(season.id, season.name) { Guard.Argument(season, nameof(season)).NotNull(); Guard.Argument(season.year, nameof(season.year)).NotNull().NotEmpty(); StartDate = season.start_date; EndDate = season.end_date; Year = season.year; if (season.start_timeSpecified) { StartDate = SdkInfo.CombineDateAndTime(season.start_date, season.start_time); } if (season.end_timeSpecified) { EndDate = SdkInfo.CombineDateAndTime(season.end_date, season.end_time); } }
/// <summary> /// Initializes a new instance of the <see cref="SeasonDTO"/> class /// </summary> /// <param name="season">A <see cref="seasonExtended"/> containing information about a season.</param> internal SeasonDTO(currentSeason season) : base(season.id, season.name) { Guard.Argument(season, nameof(season)).NotNull(); StartDate = season.start_date; EndDate = season.end_date; Year = season.year; if (season.start_timeSpecified) { StartDate = SdkInfo.CombineDateAndTime(season.start_date, season.start_time); } if (season.end_timeSpecified) { EndDate = SdkInfo.CombineDateAndTime(season.end_date, season.end_time); } URN.TryParse(season.tournament_id, out var tId); TournamentId = tId; }