# IPartitionKeyProvider.GetPartitionKey(string, GrainId)

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

```csharp
public abstract ValueTask<string> GetPartitionKey(string grainType, GrainId grainId)
```

Creates a partition key for the provided grain.

### Parameters

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

### Returns

The partition key.
