Exemplo n.º 1
0
        public static SportEvent Parse(dynamic dynamicXml)
        {
            if (dynamicXml == null)
            {
                return(null);
            }

            var builder = new SportEvent
            {
                Competitors     = Team.ParseList(dynamicXml.Competitors?.GetCompetitorList()),
                Id              = dynamicXml.Id,
                Liveodds        = dynamicXml.Liveodds,
                Name            = dynamicXml.Name,
                Parent          = ParentStage.Parse(dynamicXml.Parent),
                Races           = SportEventChild.ParseList(dynamicXml.Races?.GetSportEventList()),
                Scheduled       = dynamicXml.Scheduled <DateTimeOffset?>(),
                ScheduledEnd    = dynamicXml.ScheduledEnd <DateTimeOffset?>(),
                Season          = Responses.Season.Parse(dynamicXml.Season),
                Status          = dynamicXml.Status,
                Tournament      = Responses.Tournament.Parse(dynamicXml.Tournament),
                TournamentRound = MatchRound.Parse(dynamicXml.TournamentRound),
                Type            = dynamicXml.Type
            };

            return(builder);
        }
Exemplo n.º 2
0
        public static Schedule Parse(dynamic dynamicXml)
        {
            if (dynamicXml == null)
            {
                return(null);
            }

            var builder = new Schedule
            {
                GeneratedOn = dynamicXml.GeneratedAt <DateTimeOffset>(),
                SportEvents = SportEvent.ParseList(dynamicXml.GetSportEventList())
            };

            return(builder);
        }