public sealed class SpannerParameterCollection : DbParameterCollection, IDataParameterCollection, IList, ICollection, IEnumerable<SpannerParameter>, IEnumerable
Reference documentation and code samples for the Google.Cloud.Spanner.Data class SpannerParameterCollection.
Represents a collection of parameters associated with a SpannerCommand and their respective mappings to columns in a DataSet.
Namespace
Google.Cloud.Spanner.DataAssembly
Google.Cloud.Spanner.Data.dll
Constructors
SpannerParameterCollection(IEnumerable<SpannerParameter>)
public SpannerParameterCollection(IEnumerable<SpannerParameter> initialParameters = null)
Initializes a new SpannerParameterCollection with the given set of optional SpannerParameter objects.
Parameter | |
---|---|
Name | Description |
initialParameters | IEnumerableSpannerParameter The initial parameters to include in the collection. |
Properties
Count
public override int Count { get; }
Specifies the number of items in the collection.
Property Value | |
---|---|
Type | Description |
int | The number of items in the collection. |
IsFixedSize
public override bool IsFixedSize { get; }
Specifies whether the collection is a fixed size.
Property Value | |
---|---|
Type | Description |
bool |
IsReadOnly
public override bool IsReadOnly { get; }
Specifies whether the collection is read-only.
Property Value | |
---|---|
Type | Description |
bool |
IsSynchronized
public override bool IsSynchronized { get; }
Specifies whether the collection is synchronized.
Property Value | |
---|---|
Type | Description |
bool |
SyncRoot
public override object SyncRoot { get; }
Specifies the object to be used to synchronize access to the collection.
Property Value | |
---|---|
Type | Description |
object | A object to be used to synchronize access to the DbParameterCollection. |
Methods
Add(object)
public override int Add(object value)
Adds the specified DbParameter object to the DbParameterCollection.
Parameter | |
---|---|
Name | Description |
value | object The Value of the DbParameter to add to the collection. |
Returns | |
---|---|
Type | Description |
int | The index of the DbParameter object in the collection. |
Add(string, SpannerDbType)
public SpannerParameter Add(string parameterName, SpannerDbType dbType)
Adds a new SpannerParameter to the SpannerParameterCollection.
Parameters | |
---|---|
Name | Description |
parameterName | string The name of the parameter. For Insert, Update and Delete commands, this name should be the name of a valid Column in a Spanner table. In Select commands, this name should be the name of a parameter used in the SQL Query. Must not be null |
dbType | SpannerDbType One of the SpannerDbType values that indicates the type of the parameter. Must not be null. |
Returns | |
---|---|
Type | Description |
SpannerParameter | The parameter which has been added. |
Add(string, SpannerDbType, object)
public SpannerParameter Add(string parameterName, SpannerDbType dbType, object value)
Adds a new SpannerParameter to the SpannerParameterCollection
Parameters | |
---|---|
Name | Description |
parameterName | string The name of the parameter. For Insert, Update and Delete commands, this name should be the name of a valid Column in a Spanner table. In Select commands, this name should be the name of a parameter used in the SQL Query. Must not be null. |
dbType | SpannerDbType One of the SpannerDbType values that indicates the type of the parameter. Must not be null. |
value | object An object that is the value of the SpannerParameter. May be null. |
Returns | |
---|---|
Type | Description |
SpannerParameter | The parameter which has been added. |
AddRange(Array)
public override void AddRange(Array values)
Adds an array of items with the specified values to the DbParameterCollection.
Parameter | |
---|---|
Name | Description |
values | Array An array of values of type DbParameter to add to the collection. |
Clear()
public override void Clear()
Removes all DbParameter values from the DbParameterCollection.
Clone()
public SpannerParameterCollection Clone()
Clones the collection.
Returns | |
---|---|
Type | Description |
SpannerParameterCollection | A cloned copy of this instance. |
Contains(object)
public override bool Contains(object value)
Indicates whether a DbParameter with the specified Value is contained in the collection.
Parameter | |
---|---|
Name | Description |
value | object The Value of the DbParameter to look for in the collection. |
Returns | |
---|---|
Type | Description |
bool | true if the DbParameter is in the collection; otherwise false. |
Contains(string)
public override bool Contains(string value)
Indicates whether a DbParameter with the specified name exists in the collection.
Parameter | |
---|---|
Name | Description |
value | string The name of the DbParameter to look for in the collection. |
Returns | |
---|---|
Type | Description |
bool | true if the DbParameter is in the collection; otherwise false. |
CopyTo(Array, int)
public override void CopyTo(Array array, int index)
Copies an array of items to the collection starting at the specified index.
Parameters | |
---|---|
Name | Description |
array | Array The array of items to copy to the collection. |
index | int The index in the collection to copy the items. |
GetEnumerator()
public override IEnumerator GetEnumerator()
Exposes the GetEnumerator() method, which supports a simple iteration over a collection by a .NET Framework data provider.
Returns | |
---|---|
Type | Description |
IEnumerator | An IEnumerator that can be used to iterate through the collection. |
GetParameter(int)
protected override DbParameter GetParameter(int index)
Returns the DbParameter object at the specified index in the collection.
Parameter | |
---|---|
Name | Description |
index | int The index of the DbParameter in the collection. |
Returns | |
---|---|
Type | Description |
DbParameter | The DbParameter object at the specified index in the collection. |
GetParameter(string)
protected override DbParameter GetParameter(string parameterName)
Returns DbParameter the object with the specified name.
Parameter | |
---|---|
Name | Description |
parameterName | string The name of the DbParameter in the collection. |
Returns | |
---|---|
Type | Description |
DbParameter | The DbParameter the object with the specified name. |
IndexOf(object)
public override int IndexOf(object value)
Returns the index of the specified DbParameter object.
Parameter | |
---|---|
Name | Description |
value | object The DbParameter object in the collection. |
Returns | |
---|---|
Type | Description |
int | The index of the specified DbParameter object. |
IndexOf(string)
public override int IndexOf(string parameterName)
Returns the index of the DbParameter object with the specified name.
Parameter | |
---|---|
Name | Description |
parameterName | string The name of the DbParameter object in the collection. |
Returns | |
---|---|
Type | Description |
int | The index of the DbParameter object with the specified name. |
Insert(int, object)
public override void Insert(int index, object value)
Inserts the specified index of the DbParameter object with the specified name into the collection at the specified index.
Parameters | |
---|---|
Name | Description |
index | int The index at which to insert the DbParameter object. |
value | object The DbParameter object to insert into the collection. |
Remove(object)
public override void Remove(object value)
Removes the specified DbParameter object from the collection.
Parameter | |
---|---|
Name | Description |
value | object The DbParameter object to remove. |
RemoveAt(int)
public override void RemoveAt(int index)
Removes the DbParameter object at the specified from the collection.
Parameter | |
---|---|
Name | Description |
index | int The index where the DbParameter object is located. |
RemoveAt(string)
public override void RemoveAt(string parameterName)
Removes the DbParameter object with the specified name from the collection.
Parameter | |
---|---|
Name | Description |
parameterName | string The name of the DbParameter object to remove. |
SetParameter(int, DbParameter)
protected override void SetParameter(int index, DbParameter value)
Sets the DbParameter object at the specified index to a new value.
Parameters | |
---|---|
Name | Description |
index | int The index where the DbParameter object is located. |
value | DbParameter The new DbParameter value. |
SetParameter(string, DbParameter)
protected override void SetParameter(string parameterName, DbParameter value)
Sets the DbParameter object with the specified name to a new value.
Parameters | |
---|---|
Name | Description |
parameterName | string The name of the DbParameter object in the collection. |
value | DbParameter The new DbParameter value. |