/// <summary> /// Remove an existing <see cref="IReliableIndexedDictionary{TKey, TValue}"/> with the given name, along with its indexes. /// The state is permanently removed from storage and all replicas when this transaction commits. /// </summary> /// <remarks> /// The index definitions indicate the indexes that should be created, or which should exist with this reliable collection. The index definitions should be /// consistent when creating/reading/removing reliable collections, and should not be changed after creation. Doing so can cause the index to become out of sync /// with the primary reliable collection, which will cause runtime exceptions. /// </remarks> public static async Task RemoveIndexedAsync <TKey, TValue>(this IReliableStateManager stateManager, Uri name, TimeSpan timeout, params IIndexDefinition <TKey, TValue>[] indexes) where TKey : IComparable <TKey>, IEquatable <TKey> { using (var tx = stateManager.CreateTransaction()) { await stateManager.RemoveIndexedAsync(tx, name, timeout, indexes).ConfigureAwait(false); await tx.CommitAsync().ConfigureAwait(false); } }
/// <summary> /// Remove an existing <see cref="IReliableIndexedDictionary{TKey, TValue}"/> with the given name, along with its indexes. /// The state is permanently removed from storage and all replicas when this transaction commits. /// </summary> /// <remarks> /// The index definitions indicate the indexes that should be created, or which should exist with this reliable collection. The index definitions should be /// consistent when creating/reading/removing reliable collections, and should not be changed after creation. Doing so can cause the index to become out of sync /// with the primary reliable collection, which will cause runtime exceptions. /// </remarks> public static async Task RemoveIndexedAsync <TKey, TValue>(this IReliableStateManager stateManager, ITransaction tx, string name, TimeSpan timeout, params IIndexDefinition <TKey, TValue>[] indexes) where TKey : IComparable <TKey>, IEquatable <TKey> { var result = await stateManager.TryGetAsync <IReliableDictionary2 <TKey, TValue> >(name).ConfigureAwait(false); if (result.HasValue) { await stateManager.RemoveIndexedAsync(tx, result.Value.Name, timeout, indexes).ConfigureAwait(false); } }
/// <summary> /// Remove an existing <see cref="IReliableIndexedDictionary{TKey, TValue}"/> with the given name, along with its indexes. /// The state is permanently removed from storage and all replicas when this transaction commits. /// </summary> /// <remarks> /// The index definitions indicate the indexes that should be created, or which should exist with this reliable collection. The index definitions should be /// consistent when creating/reading/removing reliable collections, and should not be changed after creation. Doing so can cause the index to become out of sync /// with the primary reliable collection, which will cause runtime exceptions. /// </remarks> public static Task RemoveIndexedAsync <TKey, TValue>(this IReliableStateManager stateManager, ITransaction tx, Uri name, params IIndexDefinition <TKey, TValue>[] indexes) where TKey : IComparable <TKey>, IEquatable <TKey> { return(stateManager.RemoveIndexedAsync(tx, name, DefaultTimeout, indexes)); }