State Manager. Get OrAdd State Async<T>(String, T, CancellationToken) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets an actor state with the given state name if it exists. If it does not exist, creates and new state with the specified name and value.
public System.Threading.Tasks.Task<T> GetOrAddStateAsync<T> (string stateName, T value, System.Threading.CancellationToken cancellationToken = default);
abstract member GetOrAddStateAsync : string * 'T * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
Public Function GetOrAddStateAsync(Of T) (stateName As String, value As T, Optional cancellationToken As CancellationToken = Nothing) As Task(Of T)
Type of value associated with given state name.
Name of the actor state to get or add.
Value of the actor state to add if it does not exist.
The token to monitor for cancellation requests.
A task that represents the asynchronous get or add operation. The value of TResult parameter contains value of actor state with given state name.
The specified state name is null. Provide a valid state name string.
The request was canceled using the specified
The type of state value
T must be Data Contract serializable.