public static CompetitorProfile Parse(dynamic dynamicXml)
        {
            if (dynamicXml == null)
            {
                return(null);
            }

            var builder = new CompetitorProfile
            {
                Competitor        = Team.Parse(dynamicXml.Competitor),
                GeneratedOn       = dynamicXml.GeneratedAt <DateTimeOffset?>(),
                Jerseys           = Jersey.ParseList(dynamicXml.Jerseys?.GetJerseyList()),
                Manager           = Responses.Manager.Parse(dynamicXml.Manager),
                Players           = Player.ParseList(dynamicXml.Players?.GetPlayerList()),
                RaceDriverProfile = Responses.RaceDriverProfile.Parse(dynamicXml.RaceDriverProfile),
                Venue             = Responses.Venue.Parse(dynamicXml.Venue)
            };

            return(builder);
        }
Esempio n. 2
0
        public static Jersey Parse(dynamic dynamicXml)
        {
            if (dynamicXml == null)
            {
                return(null);
            }

            var builder = new Jersey
            {
                Type              = dynamicXml.Type,
                Base              = dynamicXml.Base,
                Sleeve            = dynamicXml.Sleeve,
                Number            = dynamicXml.Number,
                Stripes           = dynamicXml.Stripes <bool?>(),
                HorizontalStripes = dynamicXml.HorizontalStripes <bool?>(),
                SquaresField      = dynamicXml.Squares <bool?>(),
                SplitField        = dynamicXml.Split <bool?>(),
            };

            return(builder);
        }