# ReferencedObjectCollection.GetReferenceIndex(object?)

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

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Serialization/Session/ReferencedObjectCollection.cs#L157-L171)

```csharp
public int GetReferenceIndex(object? value)
```

Gets the index of the reference, or `-1` if the object has not been encountered before.

### Parameters

- `value` (`object?`): The value.

### Returns

The index of the reference, or `-1` if the object has not been encountered before.
