Ejemplo n.º 1
0
        internal static ISingleTypeMapper <BookmakerDetailsDTO> Create(bookmaker_details data, TimeSpan serverTimeDifference)
        {
            Guard.Argument(data, nameof(data)).NotNull();
            Guard.Argument(serverTimeDifference, nameof(serverTimeDifference)).Require(serverTimeDifference != null);

            return(new BookmakerDetailsMapper(data, serverTimeDifference));
        }
Ejemplo n.º 2
0
        internal static ISingleTypeMapper <BookmakerDetailsDTO> Create(bookmaker_details data, TimeSpan serverTimeDifference)
        {
            Contract.Requires(data != null);
            Contract.Requires(serverTimeDifference != null);

            return(new BookmakerDetailsMapper(data, serverTimeDifference));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BookmakerDetailsMapper"/> class
        /// </summary>
        /// <param name="data">A <see cref="bookmaker_details"/> instance containing bookmaker details data</param>
        /// <param name="serverTimeDifference">The server time difference</param>
        public BookmakerDetailsMapper(bookmaker_details data, TimeSpan serverTimeDifference)
        {
            Contract.Requires(data != null);
            Contract.Requires(serverTimeDifference != null);

            _data = data;
            _serverTimeDifference = serverTimeDifference;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BookmakerDetailsMapper"/> class
        /// </summary>
        /// <param name="data">A <see cref="bookmaker_details"/> instance containing bookmaker details data</param>
        /// <param name="serverTimeDifference">The server time difference</param>
        public BookmakerDetailsMapper(bookmaker_details data, TimeSpan serverTimeDifference)
        {
            Guard.Argument(data, nameof(data)).NotNull();
            Guard.Argument(serverTimeDifference, nameof(serverTimeDifference)).Require(serverTimeDifference != null);

            _data = data;
            _serverTimeDifference = serverTimeDifference;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BookmakerDetailsDTO"/> class
        /// </summary>
        /// <param name="msg">The MSG</param>
        /// <param name="serverTimeDifference">The server time difference</param>
        public BookmakerDetailsDTO(bookmaker_details msg, TimeSpan serverTimeDifference)
        {
            Guard.Argument(msg, nameof(msg)).NotNull();

            Id                   = msg.bookmaker_id;
            VirtualHost          = msg.virtual_host;
            Expires              = msg.expire_atSpecified ? (DateTime?)msg.expire_at : null;
            ResponseCode         = RestMapperHelper.MapResponseCode(msg.response_code, msg.response_codeSpecified);
            Message              = msg.message;
            ServerTimeDifference = serverTimeDifference;
        }
Ejemplo n.º 6
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="BookmakerDetailsDTO" /> class
        /// </summary>
        /// <param name="msg">The MSG</param>
        /// <param name="serverTimeDifference">The server time difference</param>
        public BookmakerDetailsDTO(bookmaker_details msg, TimeSpan serverTimeDifference)
        {
            Contract.Requires(msg != null);

            Id                   = msg.bookmaker_id;
            VirtualHost          = msg.virtual_host;
            Expires              = msg.expire_atSpecified ? (DateTime?)msg.expire_at : null;
            ResponseCode         = RestMapperHelper.MapResponseCode(msg.response_code, msg.response_codeSpecified);
            Message              = msg.message;
            ServerTimeDifference = serverTimeDifference;
        }
        /// <summary>
        /// Builds the bookmaker details
        /// </summary>
        /// <param name="id">The identifier</param>
        /// <param name="expiresAt">The expires at</param>
        /// <param name="responseCode">The response code</param>
        /// <param name="virtualHost">The virtual host</param>
        /// <returns>bookmaker_details</returns>
        public static bookmaker_details BuildBookmakerDetails(int?id, DateTime?expiresAt, response_code?responseCode, string virtualHost)
        {
            var record = new bookmaker_details
            {
                bookmaker_id           = id ?? 0,
                bookmaker_idSpecified  = id != null,
                expire_atSpecified     = expiresAt != null,
                response_codeSpecified = responseCode != null,
                virtual_host           = virtualHost
            };

            if (responseCode != null)
            {
                record.response_code = responseCode.Value;
            }
            if (expiresAt != null)
            {
                record.expire_at = expiresAt.Value;
            }

            return(record);
        }