public static OddsChangeEventStatus Parse(dynamic dynamicXml) { if (dynamicXml == null) { return(null); } var builder = new OddsChangeEventStatus { Claims = ParseClaims(), Clock = OddsChangeClock.Parse(dynamicXml.Clock), MatchStatus = dynamicXml.MatchStatus <int>(), PeriodScores = OddsChangePeriodScore.ParseList(dynamicXml.PeriodScores?.GetPeriodScoreList()), Results = OddsChangeResult.ParseList(dynamicXml.Results?.GetResultList()), Statistics = OddsChangeStatistics.Parse(dynamicXml.Statistics), Status = dynamicXml.Status <GameEventStatus>(), AwayScore = dynamicXml.AwayScore <double?>(), HomeScore = dynamicXml.HomeScore <double?>(), AwayGameScore = dynamicXml.AwayGamescore <double?>(), HomeGameScore = dynamicXml.HomeGamescore <double?>(), AwayPenaltyScore = dynamicXml.AwayPenaltyScore <double?>(), HomePenaltyScore = dynamicXml.HomePenaltyScore <double?>(), CurrentServer = dynamicXml.CurrentServer <byte?>(), }; return(builder); Dictionary <string, string> ParseClaims() { return(((IDictionary <string, string>)dynamicXml.GetAttributes()) .Where(x => x.Key != "status" && x.Key != "match_status") .ToDictionary(k => k.Key, v => v.Value)); } }
public static OddsChangeStatistics Parse(dynamic dynamicXml) { if (dynamicXml == null) { return(null); } var statisticsBuilder = new OddsChangeStatistics { AwayYellowCards = dynamicXml.yellowCards.Away <int>(), HomeYellowCards = dynamicXml.yellowCards.Home <int>(), AwayYellowRedCards = dynamicXml.yellowRedCards.Away <int>(), HomeYellowRedCards = dynamicXml.yellowRedCards.Home <int>(), AwayRedCards = dynamicXml.redCards.Away <int>(), HomeRedCards = dynamicXml.redCards.Home <int>(), AwayCorners = dynamicXml.corners.Away <int>(), HomeCorners = dynamicXml.corners.Home <int>() }; return(statisticsBuilder); }