# DefaultDocumentIdProvider Methods

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

## GetDocumentIdentifiers(string, GrainId) {#getdocumentidentifiers-string-orleans-runtime-grainid-89425612}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.persistence.cosmos.defaultdocumentidprovider/methods/getdocumentidentifiers-string-orleans-runtime-grainid-89425612/)

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

```csharp
public ValueTask<(string DocumentId, string PartitionKey)> DefaultDocumentIdProvider.GetDocumentIdentifiers(string grainType, GrainId grainId)
```

Gets the document identifier for the specified grain.

### Parameters

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

### Returns

The document id and partition key.

## GetId(string, GrainId) {#getid-string-orleans-runtime-grainid-028bc82f}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.persistence.cosmos.defaultdocumentidprovider/methods/getid-string-orleans-runtime-grainid-028bc82f/)

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

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

Gets the id for the specified grain document.

### Parameters

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

### Returns

The document id.

## GetPartitionKey(string, GrainId) {#getpartitionkey-string-orleans-runtime-grainid-37e81fff}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.persistence.cosmos/orleans.persistence.cosmos.defaultdocumentidprovider/methods/getpartitionkey-string-orleans-runtime-grainid-37e81fff/)

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