# GrainReference Constructors

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainreference/)

## GrainReference(GrainReferenceShared, IdSpan) {#constructor-orleans-runtime-grainreferenceshared-orleans-runtime-idspan-4508a7e2}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainreference/constructors/constructor-orleans-runtime-grainreferenceshared-orleans-runtime-idspan-4508a7e2/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Core.Abstractions/Runtime/GrainReference.cs#L307-L311)

```csharp
protected GrainReference(GrainReferenceShared shared, IdSpan key)
```

Initializes a new instance of the [GrainReference](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainreference/) class.

### Parameters

- `shared` (`GrainReferenceShared`): The grain reference functionality which is shared by all grain references of a given type.
- `key` (`IdSpan`): The key portion of the grain id.
