# Google Cloud Spanner v1 API - Class TransactionSelector (5.13.0-beta07)

5.13.0-beta07 5.13.0-beta06 5.12.0 (latest) 5.11.0 5.10.0 5.9.0 5.8.0 5.7.0 5.6.0 5.5.0 5.4.0 5.3.0 5.2.0 5.1.0 5.0.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.15.1 3.14.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0

    public sealed class TransactionSelector : IMessage<TransactionSelector>, IEquatable<TransactionSelector>, IDeepCloneable<TransactionSelector>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud Spanner v1 API class TransactionSelector.

This message is used to select the transaction in which a
\[Read\]\[google.spanner.v1.Spanner.Read\] or
\[ExecuteSql\]\[google.spanner.v1.Spanner.ExecuteSql\] call runs.

See \[TransactionOptions\]\[google.spanner.v1.TransactionOptions\] for more
information about transactions.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> TransactionSelector

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[TransactionSelector](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionSelector), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[TransactionSelector](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionSelector), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[TransactionSelector](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionSelector), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Spanner.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1)

## Assembly

Google.Cloud.Spanner.V1.dll

## Constructors

### TransactionSelector()

    public TransactionSelector()

### TransactionSelector(TransactionSelector)

    public TransactionSelector(TransactionSelector other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionSelector` |

## Properties

### Begin

    public TransactionOptions Begin { get; set; }

Begin a new transaction and execute this read or SQL query in
it. The transaction ID of the new transaction is returned in
\[ResultSetMetadata.transaction\]\[google.spanner.v1.ResultSetMetadata.transaction\],
which is a \[Transaction\]\[google.spanner.v1.Transaction\].

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions` |   |

### HasId

    public bool HasId { get; }

Gets whether the "id" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### Id

    public ByteString Id { get; set; }

Execute the read or SQL query in a previously-started transaction.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString.html` |   |

### SelectorCase

    public TransactionSelector.SelectorOneofCase SelectorCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionSelectorhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionSelector.SelectorOneofCase` |   |

### SingleUse

    public TransactionOptions SingleUse { get; set; }

Execute the read or SQL query in a temporary transaction.
This is the most efficient way to execute a transaction that
consists of a single SQL query.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.TransactionOptions` |   |