共用方式為


IReliableDictionary<TKey,TValue>.CreateEnumerableAsync Method

Definition

Overloads

CreateEnumerableAsync(ITransaction)

Creates an asynchronous enumerator over the IReliableDictionary<TKey,TValue>.

CreateEnumerableAsync(ITransaction, EnumerationMode)

Creates an asynchronous enumerator over the IReliableDictionary<TKey,TValue>.

CreateEnumerableAsync(ITransaction, Func<TKey,Boolean>, EnumerationMode)

Creates an asynchronous enumerator over the IReliableDictionary<TKey,TValue>.

CreateEnumerableAsync(ITransaction)

Creates an asynchronous enumerator over the IReliableDictionary<TKey,TValue>.

public System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>> CreateEnumerableAsync (Microsoft.ServiceFabric.Data.ITransaction txn);
abstract member CreateEnumerableAsync : Microsoft.ServiceFabric.Data.ITransaction -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<'Key, 'Value>>>
Public Function CreateEnumerableAsync (txn As ITransaction) As Task(Of IAsyncEnumerable(Of KeyValuePair(Of TKey, TValue)))

Parameters

txn
ITransaction

The transaction to associate this operation with.

Returns

A task that represents the asynchronous create enumerable operation. The task result is an enumerator for the Reliable Dictionary.

Exceptions

Indicates that the IReliableDictionary cannot serve reads at the moment. This exception can be thrown in all ReplicaRoles. One reason it may be thrown in the Primary role is loss of ReadStatus. One reason it may be thrown in the ActiveSecondary role is that Reliable Collection's state is not yet consistent.

The transaction has been internally faulted by the system. Retry the operation on a new transaction

Thrown when a method call is invalid for the object's current state. Example, transaction used is already terminated: committed or aborted by the user. If this exception is thrown, it is highly likely that there is a bug in the service code of the use of transactions.

Indicates that the Reliable Dictionary is closed or deleted.

Remarks

The returned enumerator is safe to use concurrently with reads and writes to the Reliable Dictionary. It represents a snapshot consistent view. Please note that GetAsyncEnumerator() needs to be called on the returned IAsyncEnumerable in order to enumerate. Example usage can be seen here.

Applies to

CreateEnumerableAsync(ITransaction, EnumerationMode)

Creates an asynchronous enumerator over the IReliableDictionary<TKey,TValue>.

public System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>> CreateEnumerableAsync (Microsoft.ServiceFabric.Data.ITransaction txn, Microsoft.ServiceFabric.Data.Collections.EnumerationMode enumerationMode);
abstract member CreateEnumerableAsync : Microsoft.ServiceFabric.Data.ITransaction * Microsoft.ServiceFabric.Data.Collections.EnumerationMode -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<'Key, 'Value>>>
Public Function CreateEnumerableAsync (txn As ITransaction, enumerationMode As EnumerationMode) As Task(Of IAsyncEnumerable(Of KeyValuePair(Of TKey, TValue)))

Parameters

txn
ITransaction

The transaction to associate this operation with.

enumerationMode
EnumerationMode

The enumeration mode to use. The default is Unordered. Ordered enumeration is ascending only.

Returns

A task that represents the asynchronous create enumerable operation. The task result is an enumerator for the Reliable Dictionary.

Exceptions

Indicates that the IReliableDictionary cannot serve reads at the moment. This exception can be thrown in all ReplicaRoles. One reason it may be thrown in the Primary role is loss of ReadStatus. One reason it may be thrown in the ActiveSecondary role is that Reliable Collection's state is not yet consistent.

The transaction has been internally faulted by the system. Retry the operation on a new transaction

Thrown when a method call is invalid for the object's current state. Example, transaction used is already terminated: committed or aborted by the user. If this exception is thrown, it is highly likely that there is a bug in the service code of the use of transactions.

Indicates that the Reliable Dictionary is closed or deleted.

Remarks

The returned enumerator is safe to use concurrently with reads and writes to the Reliable Dictionary. It represents a snapshot consistent view. Please note that GetAsyncEnumerator() needs to be called on the returned IAsyncEnumerable in order to enumerate. Example usage can be seen here.

Applies to

CreateEnumerableAsync(ITransaction, Func<TKey,Boolean>, EnumerationMode)

Creates an asynchronous enumerator over the IReliableDictionary<TKey,TValue>.

public System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>> CreateEnumerableAsync (Microsoft.ServiceFabric.Data.ITransaction txn, Func<TKey,bool> filter, Microsoft.ServiceFabric.Data.Collections.EnumerationMode enumerationMode);
abstract member CreateEnumerableAsync : Microsoft.ServiceFabric.Data.ITransaction * Func<'Key, bool (requires 'Key :> IComparable<'Key> and 'Key :> IEquatable<'Key>)> * Microsoft.ServiceFabric.Data.Collections.EnumerationMode -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<'Key, 'Value>>>
Public Function CreateEnumerableAsync (txn As ITransaction, filter As Func(Of TKey, Boolean), enumerationMode As EnumerationMode) As Task(Of IAsyncEnumerable(Of KeyValuePair(Of TKey, TValue)))

Parameters

txn
ITransaction

The transaction to associate this operation with.

filter
Func<TKey,Boolean>

Predicate that filters the key-value pairs to include in the enumeration based on the key.

enumerationMode
EnumerationMode

The enumeration mode to use. The default is Unordered. Ordered enumeration is ascending only.

Returns

A task that represents the asynchronous create enumerable operation. The task result is an enumerator for the Reliable Dictionary.

Exceptions

Indicates that the IReliableDictionary cannot serve reads at the moment. This exception can be thrown in all ReplicaRoles. One reason it may be thrown in the Primary role is loss of ReadStatus. One reason it may be thrown in the ActiveSecondary role is that Reliable Collection's state is not yet consistent.

The transaction has been internally faulted by the system. Retry the operation on a new transaction

Thrown when a method call is invalid for the object's current state. Example, transaction used is already terminated: committed or aborted by the user. If this exception is thrown, it is highly likely that there is a bug in the service code of the use of transactions.

Indicates that the Reliable Dictionary is closed or deleted.

Remarks

The returned enumerator is safe to use concurrently with reads and writes to the Reliable Dictionary. It represents a snapshot consistent view. Please note that GetAsyncEnumerator() needs to be called on the returned IAsyncEnumerable in order to enumerate. Example usage can be seen here.

Applies to