# 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/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Session/ReferencedObjectCollection.cs#L158-L172)

```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.
