# Google BigQuery v2 API - Class DatasetExtensions (3.12.0)

3.12.0 (latest) 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.4.0 2.3.0 2.2.0

    public static class DatasetExtensions

Reference documentation and code samples for the Google BigQuery v2 API class DatasetExtensions.

Extension methods for making it easier to work with Google.Apis.Bigquery.v2.Data.Dataset

## Inheritance

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

## 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.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

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

## Assembly

Google.Cloud.BigQuery.V2.dll

## Methods

### GetDefaultPartitionExpiration(Dataset)

    public static TimeSpan? GetDefaultPartitionExpiration(this Dataset dataset)

Gets the default partition expiration period for all partitioned tables created in the dataset.
Partitioned tables will (by default) be automatically deleted this long after they are created,
unless otherwise specified, such as by [ExpirationTime](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.Table.html#Google_Apis_Bigquery_v2_Data_Table_ExpirationTime).
For partitioned tables, this values has priority over [DefaultTableExpirationMs](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.Dataset.html#Google_Apis_Bigquery_v2_Data_Dataset_DefaultTableExpirationMs).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `Google.Apis.Bigquery.v2.Data.Dataset` The dataset for which to set the expiration for. Must not be null. |

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

### GetDefaultTableExpiration(Dataset)

    public static TimeSpan? GetDefaultTableExpiration(this Dataset dataset)

Gets the default expiration period for tables created in this dataset.
Tables will (by default) be automatically deleted this long after they are created,
unless otherwise specified, such as by [ExpirationTime](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.Table.html#Google_Apis_Bigquery_v2_Data_Table_ExpirationTime).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `Google.Apis.Bigquery.v2.Data.Dataset` The dataset for which to set the expiration for. Must not be null. |

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

### SetDefaultPartitionExpiration(Dataset, TimeSpan?)

    public static Dataset SetDefaultPartitionExpiration(this Dataset dataset, TimeSpan? expiration)

Gets the default partition expiration period for all partitioned tables created in the dataset.
Partitioned tables will (by default) be automatically deleted this long after they are created,
unless otherwise specified, such as by [ExpirationTime](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.Table.html#Google_Apis_Bigquery_v2_Data_Table_ExpirationTime).
For partitioned tables, this values has priority over [DefaultTableExpirationMs](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.Dataset.html#Google_Apis_Bigquery_v2_Data_Dataset_DefaultTableExpirationMs).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `Google.Apis.Bigquery.v2.Data.Dataset` The dataset for which to set the expiration for. Must not be null. |
| `expiration` | `https://learn.microsoft.com/dotnet/api/system.timespan` The new expiration to be set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google.Apis.Bigquery.v2.Data.Dataset` | The same dataset on which the change was made. To facilitate method chaining. |

### SetDefaultTableExpiration(Dataset, TimeSpan?)

    public static Dataset SetDefaultTableExpiration(this Dataset dataset, TimeSpan? expiration)

Sets the default expiration period for tables created in this dataset.
Tables will (by default) be automatically deleted this long after they are created,
unless otherwise specified, such as by [ExpirationTime](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.Table.html#Google_Apis_Bigquery_v2_Data_Table_ExpirationTime).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `dataset` | `Google.Apis.Bigquery.v2.Data.Dataset` The dataset for which to set the expiration for. Must not be null. |
| `expiration` | `https://learn.microsoft.com/dotnet/api/system.timespan` The new expiration to be set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google.Apis.Bigquery.v2.Data.Dataset` | The same dataset on which the change was made. To facilitate method chaining. |