public async Task SetUp() { if (client is object) { await client.DisposeAsync(); client = null; } client = new RedisClient(TestConfig.SingleHost).ForAsyncOnly(); await client.FlushAllAsync(); redis = client.As <T>(); Set = redis.Sets[SetId]; Set2 = redis.Sets[SetId2]; Set3 = redis.Sets[SetId3]; }
ValueTask IRedisSetAsync.StoreDiffAsync(IRedisSetAsync fromSet, params IRedisSetAsync[] withSets) => AsAsync().StoreDiffAsync(fromSet, withSets, token: default);
=> AsyncClient.RemoveItemFromSetAsync(setId, item, token).AwaitAsTrue(); // see Remove for why true ValueTask IRedisSetAsync.StoreDiffAsync(IRedisSetAsync fromSet, IRedisSetAsync[] withSets, CancellationToken token) { var withSetIds = withSets.ToList().ConvertAll(x => x.Id).ToArray(); return(AsyncClient.StoreDifferencesFromSetAsync(setId, fromSet.Id, withSetIds, token)); }
ValueTask IRedisSetAsync.MoveAsync(string value, IRedisSetAsync toSet, CancellationToken token) => AsyncClient.MoveBetweenSetsAsync(setId, toSet.Id, value, token);
ValueTask IRedisSetAsync <T> .PopulateWithDifferencesOfAsync(IRedisSetAsync <T> fromSet, params IRedisSetAsync <T>[] withSets) => AsAsync().PopulateWithDifferencesOfAsync(fromSet, withSets, token: default);
ValueTask IRedisSetAsync <T> .PopulateWithDifferencesOfAsync(IRedisSetAsync <T> fromSet, IRedisSetAsync <T>[] withSets, CancellationToken token) => AsyncClient.StoreDifferencesFromSetAsync(this, fromSet, withSets, token);
ValueTask IRedisSetAsync <T> .MoveToAsync(T item, IRedisSetAsync <T> toSet, CancellationToken token) => AsyncClient.MoveBetweenSetsAsync(this, toSet, item, token);