Ejemplo n.º 1
0
        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 OddsChangeResult Parse(dynamic dynamicXml)
        {
            if (dynamicXml == null)
            {
                return(null);
            }

            var builder = new OddsChangeResult
            {
                Status    = dynamicXml.MatchStatusCode <int>(),
                HomeScore = dynamicXml.HomeScore <decimal>(),
                AwayScore = dynamicXml.AwayScore <decimal>()
            };

            return(builder);
        }