Skip to content

IDurableStateManager.GetOrAddState(string)

GetOrAddState(string)

abstract
public abstract TState GetOrAddState<TState>(string name)
Gets an existing state component or creates it using the registered implementation of its application contract.

Parameters

namestring
The stable, ordinal, case-sensitive state name.

Returns

The existing or newly created state instance.

Exceptions

System.InvalidOperationException
The name has an incompatible state type, the contract is not registered, or initialization has begun and the state does not exist.