AddWithValue() public method

Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value.
public AddWithValue ( string parameterName, NpgsqlDbType parameterType, int size, object value ) : Npgsql.NpgsqlParameter
parameterName string The name of the NpgsqlParameter.
parameterType NpgsqlDbType One of the NpgsqlDbType values.
size int The length of the column.
value object The Value of the NpgsqlParameter to add to the collection.
return Npgsql.NpgsqlParameter
        /// <summary>
        /// Add range with value
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="values"></param>
        public static void AddRangeWithValue(this NpgsqlParameterCollection 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);
            }
        }
    }