public async Task <TValue> Get(Core.ITransaction tx, TKey key) { var conditionalValue = await wrappedReliableDictionary.TryGetValueAsync(((ServiceFabTransaction)tx).WrappedTransaction, key); return(conditionalValue.HasValue ? conditionalValue.Value : default(TValue)); }
public async Task <(bool success, TValue value)> TryRemove(Core.ITransaction tx, TKey key) { var v = await wrappedReliableDictionary.TryRemoveAsync(((ServiceFabTransaction)tx).WrappedTransaction, key); return(v.HasValue ? (true, v.Value) : (false, default(TValue))); }
public Task <TValue> GetOrAdd(Core.ITransaction tx, TKey key, Func <TKey, TValue> addValueFactory) { return(wrappedReliableDictionary.GetOrAddAsync(((ServiceFabTransaction)tx).WrappedTransaction, key, key1 => addValueFactory.Invoke(key))); }
public Task <bool> TryAdd(Core.ITransaction tx, TKey key, TValue value) { return(wrappedReliableDictionary.TryAddAsync(((ServiceFabTransaction)tx).WrappedTransaction, key, value)); }
public Task <TValue> AddOrUpdate(Core.ITransaction tx, TKey key, TValue value, Func <TKey, TValue, TValue> updateWith) { return(wrappedReliableDictionary.AddOrUpdateAsync(((ServiceFabTransaction)tx).WrappedTransaction, key, value, updateWith)); }