public new NpgsqlParameter this[int index]
{
get
{
NpgsqlEventLog.LogIndexerGet(LogLevel.Debug, CLASSNAME, index);
return this.InternalList[index];
}
set
{
NpgsqlEventLog.LogIndexerSet(LogLevel.Debug, CLASSNAME, index, value);
NpgsqlParameter oldValue = this.InternalList[index];
if (oldValue == value)
{
// Reasigning the same value is a non-op.
return;
}
if (value.Collection != null)
{
throw new InvalidOperationException("The parameter already belongs to a collection");
}
if (value.CleanName != oldValue.CleanName)
{
InvalidateHashLookups();
}
this.InternalList[index] = value;
value.Collection = this;
oldValue.Collection = null;
}
}