# HierarchicalKey

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/Messaging/HierarchicalKey.cs#L20)

```csharp
[Orleans.Immutable]
[Orleans.Alias(Orleans.Durable.Messaging.HierarchicalKey)]
[System.Text.Json.Serialization.JsonConverter(Orleans.Durable.Messaging.HierarchicalKey.HierarchicalKeyJsonConverter)]
public readonly struct HierarchicalKey : IEquatable<HierarchicalKey>, IFormattable, IParsable<HierarchicalKey>, ISpanFormattable, ISpanParsable<HierarchicalKey>
```

An immutable, ordinal application identity formed from nonempty hierarchical segments.

## Remarks

Create constructs literal segments and escapes slash and backslash characters exactly once. Parse reads the canonical escaped path. The key wraps its canonical string; equality and hashing use that string. Applications preserve the identity across retries. Every key is well-formed UTF-16: surrogate characters appear only as high-low pairs, so distinct keys keep distinct serialized forms.

## Properties

- [IsDefault](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/properties/isdefault-fac547ef/)
- [Length](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/properties/length-56ccd5b5/)

## Methods

- [Append(HierarchicalKey)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/append-orleans-durable-messaging-hierarchicalkey-8297959a/)
- [Create(ReadOnlySpan&lt;string&gt;)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/create-params-system-readonlyspan-string-71d646c0/)
- [Create(string)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/create-string-ee1c186f/)
- [CreateChildKey(string)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/createchildkey-string-2ebf7854/)
- [Equals(HierarchicalKey)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/equals-orleans-durable-messaging-hierarchicalkey-4e695d3c/)
- [Equals(object?)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/equals-object-nullable-e29e5215/)
- [GetEnumerator](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/getenumerator-2305f5a4/)
- [GetHashCode](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/gethashcode-2bf64ca9/)
- [GetParent](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/getparent-05beb5ac/)
- [IsAncestorOf(HierarchicalKey)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/isancestorof-orleans-durable-messaging-hierarchicalkey-906582d7/)
- [IsChildOf(HierarchicalKey)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/ischildof-orleans-durable-messaging-hierarchicalkey-d9b87ada/)
- [IsParentOf(HierarchicalKey)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/isparentof-orleans-durable-messaging-hierarchicalkey-e934c2b4/)
- [Parse(ReadOnlySpan&lt;char&gt;, IFormatProvider?)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/parse-system-readonlyspan-char-system-iformatprovider-nullable-9284fe8c/)
- [Parse(string, IFormatProvider?)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/parse-string-system-iformatprovider-nullable-d4d68f37/)
- [ToString](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/tostring-d354ffe2/)
- [ToString(string?, IFormatProvider?)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/tostring-string-nullable-system-iformatprovider-nullable-2873d0f9/)
- [TryFormat(Span&lt;char&gt;, int, ReadOnlySpan&lt;char&gt;, IFormatProvider?)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/tryformat-system-span-char-out-int-system-readonlyspan-char-system-iformatprovid-84e523ee/)
- [TryParse(ReadOnlySpan&lt;char&gt;, IFormatProvider?, HierarchicalKey)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/tryparse-system-readonlyspan-char-system-iformatprovider-nullable-out-orleans-du-0e48e9f8/)
- [TryParse(string?, IFormatProvider?, HierarchicalKey)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/tryparse-string-nullable-system-iformatprovider-nullable-out-orleans-durable-mes-1c69a3ca/)
- [operator ==(HierarchicalKey, HierarchicalKey)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/op-equality-orleans-durable-messaging-hierarchicalkey-orleans-durable-messaging-d6e3d65a/)
- [operator !=(HierarchicalKey, HierarchicalKey)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/methods/op-inequality-orleans-durable-messaging-hierarchicalkey-orleans-durable-messagin-93f09b96/)

## Fields

- [EscapeCharacter](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/fields/escapecharacter-51fe8931/)
- [SegmentSeparator](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.messaging.hierarchicalkey/fields/segmentseparator-b0819ba9/)
