Google.Cloud.Spanner.Data - Class SpannerParameterCollection (5.0.0-beta01)

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.

Inheritance

object > MarshalByRefObject > DbParameterCollection > SpannerParameterCollection

Namespace

Google.Cloud.Spanner.Data

Assembly

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
NameDescription
initialParametersIEnumerableSpannerParameter

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
TypeDescription
int

The number of items in the collection.

Overrides

IsFixedSize

public override bool IsFixedSize { get; }

Specifies whether the collection is a fixed size.

Property Value
TypeDescription
bool

true if the collection is a fixed size; otherwise false.

Overrides

IsReadOnly

public override bool IsReadOnly { get; }

Specifies whether the collection is read-only.

Property Value
TypeDescription
bool

true if the collection is read-only; otherwise false.

Overrides

IsSynchronized

public override bool IsSynchronized { get; }

Specifies whether the collection is synchronized.

Property Value
TypeDescription
bool

true if the collection is synchronized; otherwise false.

Overrides

SyncRoot

public override object SyncRoot { get; }

Specifies the object to be used to synchronize access to the collection.

Property Value
TypeDescription
object

A object to be used to synchronize access to the DbParameterCollection.

Overrides

Methods

Add(object)

public override int Add(object value)

Adds the specified DbParameter object to the DbParameterCollection.

Parameter
NameDescription
valueobject

The Value of the DbParameter to add to the collection.

Returns
TypeDescription
int

The index of the DbParameter object in the collection.

Overrides

Add(string, SpannerDbType)

public SpannerParameter Add(string parameterName, SpannerDbType dbType)
Parameters
NameDescription
parameterNamestring

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

dbTypeSpannerDbType

One of the SpannerDbType values that indicates the type of the parameter. Must not be null.

Returns
TypeDescription
SpannerParameter

The parameter which has been added.

Add(string, SpannerDbType, object)

public SpannerParameter Add(string parameterName, SpannerDbType dbType, object value)
Parameters
NameDescription
parameterNamestring

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.

dbTypeSpannerDbType

One of the SpannerDbType values that indicates the type of the parameter. Must not be null.

valueobject

An object that is the value of the SpannerParameter. May be null.

Returns
TypeDescription
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
NameDescription
valuesArray

An array of values of type DbParameter to add to the collection.

Overrides

Clear()

public override void Clear()

Removes all DbParameter values from the DbParameterCollection.

Overrides

Clone()

public SpannerParameterCollection Clone()

Clones the collection.

Returns
TypeDescription
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
NameDescription
valueobject

The Value of the DbParameter to look for in the collection.

Returns
TypeDescription
bool

true if the DbParameter is in the collection; otherwise false.

Overrides

Contains(string)

public override bool Contains(string value)

Indicates whether a DbParameter with the specified name exists in the collection.

Parameter
NameDescription
valuestring

The name of the DbParameter to look for in the collection.

Returns
TypeDescription
bool

true if the DbParameter is in the collection; otherwise false.

Overrides

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
NameDescription
arrayArray

The array of items to copy to the collection.

indexint

The index in the collection to copy the items.

Overrides

GetEnumerator()

public override IEnumerator GetEnumerator()

Exposes the GetEnumerator() method, which supports a simple iteration over a collection by a .NET Framework data provider.

Returns
TypeDescription
IEnumerator

An IEnumerator that can be used to iterate through the collection.

Overrides

GetParameter(int)

protected override DbParameter GetParameter(int index)

Returns the DbParameter object at the specified index in the collection.

Parameter
NameDescription
indexint

The index of the DbParameter in the collection.

Returns
TypeDescription
DbParameter

The DbParameter object at the specified index in the collection.

Overrides

GetParameter(string)

protected override DbParameter GetParameter(string parameterName)

Returns DbParameter the object with the specified name.

Parameter
NameDescription
parameterNamestring

The name of the DbParameter in the collection.

Returns
TypeDescription
DbParameter

The DbParameter the object with the specified name.

Overrides

IndexOf(object)

public override int IndexOf(object value)

Returns the index of the specified DbParameter object.

Parameter
NameDescription
valueobject

The DbParameter object in the collection.

Returns
TypeDescription
int

The index of the specified DbParameter object.

Overrides

IndexOf(string)

public override int IndexOf(string parameterName)

Returns the index of the DbParameter object with the specified name.

Parameter
NameDescription
parameterNamestring

The name of the DbParameter object in the collection.

Returns
TypeDescription
int

The index of the DbParameter object with the specified name.

Overrides

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
NameDescription
indexint

The index at which to insert the DbParameter object.

valueobject

The DbParameter object to insert into the collection.

Overrides

Remove(object)

public override void Remove(object value)

Removes the specified DbParameter object from the collection.

Parameter
NameDescription
valueobject

The DbParameter object to remove.

Overrides

RemoveAt(int)

public override void RemoveAt(int index)

Removes the DbParameter object at the specified from the collection.

Parameter
NameDescription
indexint

The index where the DbParameter object is located.

Overrides

RemoveAt(string)

public override void RemoveAt(string parameterName)

Removes the DbParameter object with the specified name from the collection.

Parameter
NameDescription
parameterNamestring

The name of the DbParameter object to remove.

Overrides

SetParameter(int, DbParameter)

protected override void SetParameter(int index, DbParameter value)

Sets the DbParameter object at the specified index to a new value.

Parameters
NameDescription
indexint

The index where the DbParameter object is located.

valueDbParameter

The new DbParameter value.

Overrides

SetParameter(string, DbParameter)

protected override void SetParameter(string parameterName, DbParameter value)

Sets the DbParameter object with the specified name to a new value.

Parameters
NameDescription
parameterNamestring

The name of the DbParameter object in the collection.

valueDbParameter

The new DbParameter value.

Overrides