public static NpgsqlParameterCollection AddLockedParameter(this NpgsqlParameterCollection pc) { NpgsqlParameter sqlParameter = new NpgsqlParameter(string.Format("@{0}", (object)SqlParameterName.Locked), NpgsqlDbType.Bit); sqlParameter.Direction = ParameterDirection.Output; sqlParameter.Value = Convert.DBNull; pc.Add(sqlParameter); return(pc); }
public static void AddWithValueAsEnum(this NpgsqlParameterCollection parameters, string name, string value, string enumName) { parameters.Add(new NpgsqlParameter { ParameterName = name, Value = value, DataTypeName = enumName, }); }
public static void AddValue(this NpgsqlParameterCollection collection, string key, int value) { var param = new NpgsqlParameter <int>(key, NpgsqlDbType.Integer) { TypedValue = value }; collection.Add(param); }
public static void AddValue(this NpgsqlParameterCollection collection, string key, long value) { var param = new NpgsqlParameter <long>(key, NpgsqlDbType.Bigint) { TypedValue = value }; collection.Add(param); }
public static void AddValue(this NpgsqlParameterCollection collection, string key, byte[] value) { var param = new NpgsqlParameter <byte[]>(key, NpgsqlDbType.Bytea) { TypedValue = value }; collection.Add(param); }
public static void AddValue(this NpgsqlParameterCollection collection, string key, decimal value) { var param = new NpgsqlParameter <decimal>(key, NpgsqlDbType.Numeric) { TypedValue = value }; collection.Add(param); }
public static NpgsqlParameterCollection AddTimeoutParameter(this NpgsqlParameterCollection pc, int timeout) { NpgsqlParameter sqlParameter = new NpgsqlParameter(string.Format("@{0}", (object)SqlParameterName.Timeout), NpgsqlDbType.Integer); sqlParameter.Value = (object)timeout; pc.Add(sqlParameter); AddExpiresTimeParameter(pc, timeout); return(pc); }
public static void AddValue(this NpgsqlParameterCollection collection, string key, Guid value) { var param = new NpgsqlParameter <Guid>(key, NpgsqlDbType.Uuid) { TypedValue = value }; collection.Add(param); }
public static NpgsqlParameterCollection AddSessionIdParameter(this NpgsqlParameterCollection pc, string id) { NpgsqlParameter sqlParameter = new NpgsqlParameter(string.Format("@{0}", (object)SqlParameterName.SessionId), NpgsqlDbType.Varchar, 88); sqlParameter.Value = (object)id; pc.Add(sqlParameter); return(pc); }
public static NpgsqlParameterCollection AddWithValue( this NpgsqlParameterCollection parameters, string parameterName, NpgsqlDbType dbType, object value) { var parameter = new NpgsqlParameter(parameterName, dbType); parameter.Value = value; parameters.Add(parameter); parameter.ResetDbType(); return(parameters); }
public static void AddWithJsonOrNull <T>(this NpgsqlParameterCollection parameters, string name, T value) { if (value == null) { parameters.AddWithValue(name, DBNull.Value); } else { parameters.Add(new NpgsqlParameter(name, NpgsqlDbType.Jsonb) { Value = value }); } }
public static NpgsqlParameterCollection AddLockCookieParameter(this NpgsqlParameterCollection pc, object lockId = null) { NpgsqlParameter sqlParameter = new NpgsqlParameter(string.Format("@{0}", (object)SqlParameterName.LockCookie), NpgsqlDbType.Integer); if (lockId == null) { sqlParameter.Direction = ParameterDirection.Output; sqlParameter.Value = Convert.DBNull; } else { sqlParameter.Value = lockId; } pc.Add(sqlParameter); return(pc); }
public static NpgsqlParameterCollection AddParamWithValue( this NpgsqlParameterCollection parameters, string parameterName, NpgsqlTypes.NpgsqlDbType dbType, int size, object value) { var parameter = new NpgsqlParameter(parameterName, dbType, size); parameter.Value = value; parameters.Add(parameter); if (value != DBNull.Value) { parameter.ResetDbType(); } return(parameters); }
public void AdicionarParametro(string nomeParametro, object valorParamestro) { npgsqlParameterCollection.Add(new NpgsqlParameter(nomeParametro, valorParamestro)); }
public DbParameters Put(string name, JNumber v) { if (name == null) { name = Defaults[position++]; } coll.Add(new NpgsqlParameter(name, NpgsqlDbType.Numeric) { Value = v.Decimal }); return(this); }
public static void AdicionarParametros(string strNomeParametro, object objValor) { objParametros.Add(new NpgsqlParameter(strNomeParametro, objValor)); }