/// <summary> /// Initializes a new instance of the <see cref="PeriodScoreDTO"/> class /// </summary> /// <param name="periodScore">The period score</param> public PeriodScoreDTO(periodScore periodScore) { HomeScore = (decimal)periodScore.home_score; AwayScore = (decimal)periodScore.away_score; PeriodNumber = periodScore.numberSpecified ? periodScore.number : (int?)null; MatchStatusCode = periodScore.match_status_code; Type = GetPeriodType(periodScore.type); }
/// <summary> /// Initializes a new instance of the <see cref="PeriodScoreDTO"/> class /// </summary> /// <param name="periodScore">The period score</param> public PeriodScoreDTO(periodScore periodScore) { if (decimal.TryParse(periodScore.home_score, out var homeScore)) { HomeScore = homeScore; } else if (!string.IsNullOrEmpty(periodScore.home_score)) { SdkInfo.ExecutionLog.Warn($"PeriodScore - can not parse home score: {periodScore.home_score}"); } if (decimal.TryParse(periodScore.away_score, out var awayScore)) { AwayScore = awayScore; } else if (!string.IsNullOrEmpty(periodScore.away_score)) { SdkInfo.ExecutionLog.Warn($"PeriodScore - can not parse away score: {periodScore.away_score}"); } PeriodNumber = periodScore.numberSpecified ? periodScore.number : (int?)null; MatchStatusCode = periodScore.match_status_code; Type = GetPeriodType(periodScore.type); }