public async Task Can_DeleteAll()
        {
            var tos = Factory.CreateList();
            await redis.StoreAllAsync(tos);

            var all = await redis.GetAllAsync();

            Assert.That(all.Count, Is.EqualTo(tos.Count));

            await redis.DeleteAllAsync();

            all = await redis.GetAllAsync();

            Assert.That(all.Count, Is.EqualTo(0));
        }
Example #2
0
                public async Task <List <T> > GetAllAsync(int?skip = null, int?take = null, CancellationToken token = default)
                {
                    if (skip != null || take != null)
                    {
                        var keys = (await redisTypedClient.TypeIdsSet.GetAllAsync(token)).OrderBy(x => x).AsEnumerable();
                        if (skip != null)
                        {
                            keys = keys.Skip(skip.Value);
                        }
                        if (take != null)
                        {
                            keys = keys.Take(take.Value);
                        }
                        return((await redisTypedClient.GetByIdsAsync(keys, token)).ToList());
                    }

                    return((await redisTypedClient.GetAllAsync(token)).ToList());
                }