# Codec_AddAndThrowException.Serialize(Writer&lt;TBufferWriter&gt;, AddAndThrowException)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.transactions.testkit.base/orleanscodegen.orleans.transactions.testkit.codec-addandthrowexception/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.transactions.testkit.base/orleanscodegen.orleans.transactions.testkit.codec-addandthrowexception/methods/)

```csharp
public void Serialize<TBufferWriter>(ref Writer<TBufferWriter> writer, AddAndThrowException instance)
```

Serializes the provided value.

### Parameters

- `writer` (`Writer<TBufferWriter>`): The writer.
- `instance` (`AddAndThrowException`): The value.
