public static IDbDataParameter AddParam(this IDbCommand dbCmd, string name, object value = null, ParameterDirection direction = ParameterDirection.Input, DbType?dbType = null) { var p = dbCmd.CreateParam(name, value, direction, dbType); dbCmd.Parameters.Add(p); return(p); }
public static IDbDataParameter AddParam(this IDbCommand dbCmd, string name, object value = null, ParameterDirection direction = ParameterDirection.Input, DbType?dbType = null, byte?precision = null, byte?scale = null, int?size = null, Action <IDbDataParameter> paramFilter = null) { var p = dbCmd.CreateParam(name, value, direction, dbType, precision, scale, size); paramFilter?.Invoke(p); dbCmd.Parameters.Add(p); return(p); }