/// <summary> /// Flush All Cached Item async. /// </summary> /// <returns>The async.</returns> public async Task FlushAsync() { await _localCachingProvider.FlushAsync(); try { await _distributedCachingProvider.FlushAsync(); } catch (Exception ex) { System.Console.WriteLine(ex.Message); } }
protected virtual async Task FlushAsync_Should_Succeed() { for (var i = 0; i < 5; i++) { _provider.Set($"flush:{i}", $"value{i}", _defaultTs); } for (var i = 0; i < 5; i++) { Assert.Equal($"value{i}", _provider.Get <string>($"flush:{i}").Value); } await _provider.FlushAsync(); for (var i = 0; i < 5; i++) { Assert.False(_provider.Get <string>($"flush:{i}").HasValue); } }
/// <summary> /// Clear all cache /// </summary> public async Task ClearAsync() { await _provider.FlushAsync(); }
public Task Clear() => _provider.FlushAsync();
/// <summary> /// Flush All Cached Item async. /// </summary> /// <param name="cancellationToken">cancellationToken</param> /// <returns>Task</returns> public Task FlushAsync(CancellationToken cancellationToken = default) { return(_easyCachingProvider.FlushAsync()); }
public Task ClearAsync() { return(_provider.FlushAsync()); }