# CodecProvider Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/)

## GetActivator {#getactivator-1-0aa66991}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/getactivator-1-0aa66991/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L215-L220)

```csharp
public IActivator<T> GetActivator<T>()
```

Gets an activator for the specified type.

### Returns

The activator.

## GetBaseCodec {#getbasecodec-1-69d3281d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/getbasecodec-1-69d3281d/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L270-L276)

```csharp
public IBaseCodec<TField> GetBaseCodec<TField>()
```

Gets a base codec for the specified type.

### Returns

A base codec.

## GetBaseCopier {#getbasecopier-1-d87972ad}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/getbasecopier-1-d87972ad/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L293-L298)

```csharp
public IBaseCopier<TField> GetBaseCopier<TField>()
```

Gets a base type copier capable of copying instances of type `T`.

### Returns

A base type copier capable of copying instances of type `T`.

## GetCodec(Type) {#getcodec-system-type-2ceceb09}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/getcodec-system-type-2ceceb09/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L166-L168)

```csharp
public IFieldCodec GetCodec(Type fieldType)
```

Gets a codec for the specific type.

### Parameters

- `fieldType` (`Type`): The field type.

### Returns

A codec.

## GetCodec {#getcodec-1-d7553a41}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/getcodec-1-d7553a41/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L207-L209)

```csharp
public IFieldCodec<TField> GetCodec<TField>()
```

Gets a codec for the specified type.

### Returns

A codec.

## GetDeepCopier(Type) {#getdeepcopier-system-type-a6fa238d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/getdeepcopier-system-type-a6fa238d/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L332-L334)

```csharp
public IDeepCopier GetDeepCopier(Type fieldType)
```

Gets a deep copier capable of copying instances of type `type`.

### Parameters

- `fieldType` (`Type`): The type supported by the returned copier.

### Returns

A deep copier capable of copying instances of type `type`.

## GetDeepCopier {#getdeepcopier-1-d6b285c3}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/getdeepcopier-1-d6b285c3/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L304-L306)

```csharp
public IDeepCopier<T> GetDeepCopier<T>()
```

Gets a deep copier capable of copying instances of type `T`.

### Returns

A deep copier capable of copying instances of type `T`.

## GetValueSerializer {#getvalueserializer-1-f055c8cd}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/getvalueserializer-1-f055c8cd/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L282-L287)

```csharp
public IValueSerializer<TField> GetValueSerializer<TField>()
```

Gets the value serializer for the specified type.

### Returns

A value serializer for the specified type.

## TryGetCodec(Type) {#trygetcodec-system-type-31744b94}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/trygetcodec-system-type-31744b94/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L175-L177)

```csharp
public IFieldCodec TryGetCodec(Type fieldType)
```

Gets a codec for the specific type, or `null` if no appropriate codec was found.

### Parameters

- `fieldType` (`Type`): The field type.

### Returns

A codec.

## TryGetCodec {#trygetcodec-1-ec0efaa0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/trygetcodec-1-ec0efaa0/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L146-L160)

```csharp
public IFieldCodec<TField> TryGetCodec<TField>()
```

Gets a codec for the specific type, or `null` if no appropriate codec was found.

### Returns

A codec.

## TryGetDeepCopier(Type) {#trygetdeepcopier-system-type-29acb3d6}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/trygetdeepcopier-system-type-29acb3d6/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L341-L344)

```csharp
public IDeepCopier TryGetDeepCopier(Type fieldType)
```

Gets a deep copier capable of copying instances of type `type`, or returns `null` if an appropriate copier was not found.

### Parameters

- `fieldType` (`Type`): The type supported by the returned copier.

### Returns

A deep copier capable of copying instances of type `type`, or `null` if an appropriate copier was not found.

## TryGetDeepCopier {#trygetdeepcopier-1-000167c6}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.serializers.codecprovider/methods/trygetdeepcopier-1-000167c6/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializers/CodecProvider.cs#L312-L326)

```csharp
public IDeepCopier<T> TryGetDeepCopier<T>()
```

Gets a deep copier capable of copying instances of type `T`, or returns `null` if an appropriate copier was not found.

### Returns

A deep copier capable of copying instances of type `T`, or `null` if an appropriate copier was not found.
