# Google Cloud Spanner v1 API - Class SessionPool.SessionPoolSegmentKey (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 SessionPool.SessionPoolSegmentKey : IEquatable<SessionPool.SessionPoolSegmentKey>

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

Aspects under which a session pool is segmented.

## Inheritance

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

## Implements

[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SessionPool](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionPool)[SessionPoolSegmentKey](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionPool.SessionPoolSegmentKey)

## Inherited Members

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

## 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

## Properties

### DatabaseName

    public DatabaseName DatabaseName { get; }

The database for which sessions are pooled on the associated session pool.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `Google.Cloud.Spanner.Common.V1.DatabaseName` |   |

### DatabaseRole

    public string DatabaseRole { get; }

The database role of the sessions pooled on the associated session pool.

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

## Methods

### Create(DatabaseName)

    public static SessionPool.SessionPoolSegmentKey Create(DatabaseName databaseName)

Creates a [SessionPool.SessionPoolSegmentKey](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionPool.SessionPoolSegmentKey) with the given database name.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `databaseName` | `Google.Cloud.Spanner.Common.V1.DatabaseName` The database name for the associated pool. Must not be null. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionPoolhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionPool.SessionPoolSegmentKey` |   |

### GetHashCode()

    public override int GetHashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

**Overrides** [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)

### ToString()

    public override string ToString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Overrides** [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

### WithDatabaseRole(string)

    public SessionPool.SessionPoolSegmentKey WithDatabaseRole(string databaseRole)

Creates a [SessionPool.SessionPoolSegmentKey](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionPool.SessionPoolSegmentKey) based on this one but with the given database role.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `databaseRole` | `https://learn.microsoft.com/dotnet/api/system.string` The database role for the associated pool. May be null in which case the default (public) database role is used if fine grained access control is enabled; otherwise the database role is ignored. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionPoolhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionPool.SessionPoolSegmentKey` |   |