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