# IDehydrationContext.AddBytes(string, Action&lt;T, IBufferWriter&lt;byte&gt;&gt;, T)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.idehydrationcontext/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.idehydrationcontext/methods/)

```csharp
public abstract void AddBytes<T>(string key, Action<T, IBufferWriter<byte>> valueWriter, T value)
```

Adds a sequence of bytes to the dehydration context, associating the sequence with the provided key.

### Parameters

- `key` (`string`): The key.
- `valueWriter` (`Action<T, IBufferWriter<byte>>`): A delegate used to write the provided value to the context.
- `value` (`T`): The value to provide to `valueWriter`.
