# IDurableStateManager.TryGetState(string, TState?)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.idurablestatemanager/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.idurablestatemanager/methods/)

```csharp
public abstract bool TryGetState<TState>(string name, out TState? state)
```

Attempts to retrieve an existing state component without creating it.

### Parameters

- `name` (`string`): The stable, ordinal, case-sensitive state name.
- `state` (`TState?`): The existing state, if found.

### Returns

`true` if a compatible state exists; otherwise, `false`.

### Exceptions

- `System.InvalidOperationException`: The name has an incompatible state type.
