# DefaultDocumentIdProvider.GetPartitionKey(string, GrainId)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.persistence.cosmos.defaultdocumentidprovider/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.persistence.cosmos.defaultdocumentidprovider/methods/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Azure/Orleans.Persistence.Cosmos/DefaultDocumentIdProvider.cs#L60)

```csharp
public string GetPartitionKey(string grainType, GrainId grainId)
```

Gets the Cosmos DB partition key for the specified grain document.

### Parameters

- `grainType` (`string`): The grain type.
- `grainId` (`GrainId`): The grain id.

### Returns

The document partition key.
