Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TournamentSeasonsDTO"/> class
        /// </summary>
        /// <param name="item">The item</param>
        internal TournamentSeasonsDTO(tournamentSeasons item)
        {
            Contract.Requires(item != null);

            Tournament = new TournamentInfoDTO(item.tournament);

            if (item.seasons != null && item.seasons.Any())
            {
                Seasons = item.seasons.Select(s => new SeasonDTO(s));
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TournamentSeasonsDTO"/> class
        /// </summary>
        /// <param name="item">The item</param>
        internal TournamentSeasonsDTO(tournamentSeasons item)
        {
            Guard.Argument(item, nameof(item)).NotNull();

            Tournament = new TournamentInfoDTO(item.tournament);

            if (item.seasons != null && item.seasons.Any())
            {
                Seasons = item.seasons.Select(s => new SeasonDTO(s));
            }

            GeneratedAt = item.generated_atSpecified ? item.generated_at : (DateTime?)null;
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="TournamentSeasonsMapper" /> class
        /// </summary>
        /// <param name="data">>A <see cref="tournamentSeasons" /> instance containing tournament seasons</param>
        internal TournamentSeasonsMapper(tournamentSeasons data)
        {
            Contract.Requires(data != null);

            _data = data;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TournamentSeasonsMapper"/> class
        /// </summary>
        /// <param name="data">>A <see cref="tournamentSeasons"/> instance containing tournament seasons</param>
        internal TournamentSeasonsMapper(tournamentSeasons data)
        {
            Guard.Argument(data, nameof(data)).NotNull();

            _data = data;
        }