# Data Catalog v1 API - Class ServiceCollectionExtensions (2.17.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.17.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.16.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.16.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.15.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.15.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.14.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.14.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.13.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.13.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.12.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.12.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.11.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.11.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.10.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.10.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.9.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.9.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.8.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.8.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.7.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.6.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.5.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.4.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.3.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.2.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.1.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/2.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.8.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/1.8.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/1.7.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/1.6.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/1.5.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/1.4.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/1.3.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/1.2.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)

    public static class ServiceCollectionExtensions

Reference documentation and code samples for the Data Catalog v1 API class ServiceCollectionExtensions.

Static class to provide extension methods to configure API clients.

## Inheritance

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

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

[Microsoft.Extensions.DependencyInjection](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Microsoft.Extensions.DependencyInjection)

## Assembly

Google.Cloud.DataCatalog.V1.dll

## Methods

### AddDataCatalogClient(IServiceCollection, Action\<DataCatalogClientBuilder\>)

    [Obsolete]
    public static IServiceCollection AddDataCatalogClient(this IServiceCollection services, Action<DataCatalogClientBuilder> action = null)

Adds a singleton [DataCatalogClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.DataCatalogClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.DataCatalogClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddDataCatalogClient(IServiceCollection, Action\<IServiceProvider, DataCatalogClientBuilder\>)

    [Obsolete]
    public static IServiceCollection AddDataCatalogClient(this IServiceCollection services, Action<IServiceProvider, DataCatalogClientBuilder> action)

Adds a singleton [DataCatalogClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.DataCatalogClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-2System.IServiceProviderhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.DataCatalogClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddPolicyTagManagerClient(IServiceCollection, Action\<PolicyTagManagerClientBuilder\>)

    public static IServiceCollection AddPolicyTagManagerClient(this IServiceCollection services, Action<PolicyTagManagerClientBuilder> action = null)

Adds a singleton [PolicyTagManagerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.PolicyTagManagerClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.PolicyTagManagerClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddPolicyTagManagerClient(IServiceCollection, Action\<IServiceProvider, PolicyTagManagerClientBuilder\>)

    public static IServiceCollection AddPolicyTagManagerClient(this IServiceCollection services, Action<IServiceProvider, PolicyTagManagerClientBuilder> action)

Adds a singleton [PolicyTagManagerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.PolicyTagManagerClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-2System.IServiceProviderhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.PolicyTagManagerClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddPolicyTagManagerSerializationClient(IServiceCollection, Action\<PolicyTagManagerSerializationClientBuilder\>)

    public static IServiceCollection AddPolicyTagManagerSerializationClient(this IServiceCollection services, Action<PolicyTagManagerSerializationClientBuilder> action = null)

Adds a singleton [PolicyTagManagerSerializationClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.PolicyTagManagerSerializationClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.PolicyTagManagerSerializationClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddPolicyTagManagerSerializationClient(IServiceCollection, Action\<IServiceProvider, PolicyTagManagerSerializationClientBuilder\>)

    public static IServiceCollection AddPolicyTagManagerSerializationClient(this IServiceCollection services, Action<IServiceProvider, PolicyTagManagerSerializationClientBuilder> action)

Adds a singleton [PolicyTagManagerSerializationClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.PolicyTagManagerSerializationClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-2System.IServiceProviderhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataCatalog.V1/latest/Google.Cloud.DataCatalog.V1.PolicyTagManagerSerializationClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |