Example #1
0
 public static NpgsqlParameter AddWithNullableValue(
     this DbParameterCollection parameterCollection,
     string name,
     object?value)
 {
     return(parameterCollection.AddWithValue(name, value ?? DBNull.Value));
 }
Example #2
0
 /// <summary>
 ///     Adds the parameter to the collection with the value.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="name">The name.</param>
 /// <param name="type">The type.</param>
 /// <param name="value">The value.</param>
 public static void AddWithValue <TDbParameter>(this DbParameterCollection source, string name, DbType type, object value)
     where TDbParameter : DbParameter, new()
 {
     source.AddWithValue <TDbParameter>(name, type, ParameterDirection.Input, value);
 }