예제 #1
0
        internal MySqlParameterCollection?CloneRawParameters()
        {
            if (m_parameterCollection is null)
            {
                return(null);
            }
            var parameters = new MySqlParameterCollection();

            foreach (var parameter in (IEnumerable <MySqlParameter>)m_parameterCollection)
            {
                parameters.Add(parameter.Clone());
            }
            return(parameters);
        }
        /// <summary>
        /// Add range with value
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="values"></param>
        public static void AddRangeWithValue(this MySqlParameterCollection conn, Dictionary <string, object> values)
        {
            conn.CheckNull(nameof(conn));

#if NETFRAMEWORK || NETSTANDARD2_0
            foreach (var pair in values)
            {
                var key   = pair.Key;
                var value = pair.Value;
#else
            foreach (var(key, value) in values)
            {
#endif
                conn.AddWithValue(key, value);
            }
        }
    }