# ObjectSerializer.Serialize(object, Memory&lt;byte&gt;, SerializerSession, Type)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.objectserializer/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.objectserializer/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Serializer.cs)

```csharp
public void Serialize(object value, ref Memory<byte> destination, SerializerSession session, Type type)
```

Serializes the provided `value` into `destination`.

### Parameters

- `value` (`object`): The value to serialize.
- `destination` (`Memory<byte>`): The destination where serialized data will be written.
- `session` (`SerializerSession`): The serializer session.
- `type` (`Type`): The expected type of the value.
