ReliableStateManager.IReliableStateManager.TryGetAsync Method

Definition

Overloads

IReliableStateManager.TryGetAsync<T>(Uri)

Attempts to get an IReliableState of the given type T and with the given name.

IReliableStateManager.TryGetAsync<T>(String)

Attempts to get an IReliableState of the given type T and with the given name.

IReliableStateManager.TryGetAsync<T>(Uri)

Attempts to get an IReliableState of the given type T and with the given name.

System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.ConditionalValue<T>> IReliableStateManager.TryGetAsync<T> (Uri name) where T : Microsoft.ServiceFabric.Data.IReliableState;
abstract member Microsoft.ServiceFabric.Data.IReliableStateManager.TryGetAsync : Uri -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.ConditionalValue<'T>> (requires 'T :> Microsoft.ServiceFabric.Data.IReliableState)
override this.Microsoft.ServiceFabric.Data.IReliableStateManager.TryGetAsync : Uri -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.ConditionalValue<'T>> (requires 'T :> Microsoft.ServiceFabric.Data.IReliableState)
Function TryGetAsync(Of T As IReliableState) (name As Uri) As Task(Of ConditionalValue(Of T)) Implements IReliableStateManager.TryGetAsync

Type Parameters

T

When specifying the type, you may ask for either a concrete type or an interface type. The retrieved object will be cast to the given type.

Parameters

name
Uri

The name of the IReliableState. This name must be unique in this IReliableStateManager across IReliableState types, including unrelated types.

Returns

Task that represents the asynchronous operation. The task result is a tuple indicating whether the reliable state was found, and if so the instance.

Implements

Exceptions

name is null.

The IReliableState instance is not convertible to type T.

Exception indicates that the State Manager cannot retrive a reliable collection. FabricNotReadableException can be thrown in all ReplicaRoles. For example, when a Primary or ActiveSecondary looses ReadStatus.

Indicates that the Reliable State Manager is closed.

Applies to

IReliableStateManager.TryGetAsync<T>(String)

Attempts to get an IReliableState of the given type T and with the given name.

System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.ConditionalValue<T>> IReliableStateManager.TryGetAsync<T> (string name) where T : Microsoft.ServiceFabric.Data.IReliableState;
abstract member Microsoft.ServiceFabric.Data.IReliableStateManager.TryGetAsync : string -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.ConditionalValue<'T>> (requires 'T :> Microsoft.ServiceFabric.Data.IReliableState)
override this.Microsoft.ServiceFabric.Data.IReliableStateManager.TryGetAsync : string -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.ConditionalValue<'T>> (requires 'T :> Microsoft.ServiceFabric.Data.IReliableState)
Function TryGetAsync(Of T As IReliableState) (name As String) As Task(Of ConditionalValue(Of T)) Implements IReliableStateManager.TryGetAsync

Type Parameters

T

When specifying the type, you may ask for either a concrete type or an interface type. The retrieved object will be cast to the given type.

Parameters

name
String

The name of the IReliableState. This name must be unique in this IReliableStateManager across IReliableState types, including unrelated types.

Returns

Task that represents the asynchronous operation. The task result is a tuple indicating whether the reliable state was found, and if so the instance.

Implements

Exceptions

name is null.

The IReliableState instance is not convertible to type T.

Exception indicates that the State Manager cannot retrive a reliable collection. FabricNotReadableException can be thrown in all ReplicaRoles. For example, when a Primary or ActiveSecondary looses ReadStatus.

Indicates that the Reliable State Manager is closed.

Applies to