4.6.0 (latest) 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.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.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.5.0 2.4.0 2.3.1

    public sealed class ConverterRegistry : IEnumerable

Reference documentation and code samples for the Firestore API class ConverterRegistry.

Registry of custom converters. This is used to avoid requiring Firestore-specific attributes on types
which may be intended to be non-Firestore-specific. The registry may be specified when creating a [FirestoreDb](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FirestoreDb)
via [ConverterRegistry](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.FirestoreDbBuilder#Google_Cloud_Firestore_FirestoreDbBuilder_ConverterRegistry).

## Inheritance

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

## Implements

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable)

## 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.Firestore](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore)

## Assembly

Google.Cloud.Firestore.dll

## Methods

### Add\<T\>(IFirestoreConverter\<T\>)

    public void Add<T>(IFirestoreConverter<T> converter)

Adds the given converter to the registry.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `converter` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.IFirestoreConverter-1` The converter to add. Must not be null. |

| **Type Parameter** ||
|---|---|
| **Name** | **Description** |
| `T` | The type that `converter` converts to/from. |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.argumentexception` | There is already a converter in the registry for the given type. |

### Add\<T\>(IFirestoreTypeDiscriminator\<T\>)

    public void Add<T>(IFirestoreTypeDiscriminator<T> discriminator)

Adds the given type discriminator to the registry.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `discriminator` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.IFirestoreTypeDiscriminator-1` The type discriminator to add. Must not be null. |

| **Type Parameter** ||
|---|---|
| **Name** | **Description** |
| `T` | The type for which `discriminator` can determine a concrete type. |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.argumentexception` | There is already a type discriminator in the registry for the given type. |