# TaskIdExtensions

Package: [Microsoft.Orleans.Durable](/orleans/docs/api/csharp/microsoft.orleans.durable/) 10.0.0-alpha.1

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/DurableTasks/Protocol/TaskIdExtensions.cs#L15)

```csharp
public static class TaskIdExtensions
```

Extension methods for converting between [TaskId](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.taskid/) and [HierarchicalKey](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/).

## Remarks

These extensions enable interoperability between the [TaskId](/orleans/docs/api/csharp/microsoft.orleans.durable.abstractions/orleans.durable.tasks.taskid/) type from Orleans.Durable.Tasks and the [HierarchicalKey](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/) type from Orleans Messaging. Both types share the same string representation and hierarchical semantics, making conversion straightforward via string parsing.

## Methods

- [ToHierarchicalKey(TaskId)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.taskidextensions/methods/tohierarchicalkey-this-orleans-durable-tasks-taskid-11f97919/)
- [ToTaskId(HierarchicalKey)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.taskidextensions/methods/totaskid-this-orleans-durable-messaging-hierarchicalkey-4521b2e1/)
- [ToTaskId(HierarchicalKey?)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.taskidextensions/methods/totaskid-this-orleans-durable-messaging-hierarchicalkey-nullable-2fd1e1dc/)
