I am using StackExchange.Redis client with Azure Redis Cache Service. Here is my class,
public class RedisCacheService : ICacheService
{
private readonly ISe
To remove a single item:
_cache.KeyDelete(key);
To remove all involves the FLUSHDB
or FLUSHALL
redis command; both are available in StackExchange.Redis; but, for reasons discussed here, they are not on the IDatabase
API (because: they affect servers, not logical databases).
As per the "So how do I use them?" on that page:
server.FlushDatabase(); // to wipe a single database, 0 by default
server.FlushAllDatabases(); // to wipe all databases
(quite possibly after using GetEndpoints()
on the multiplexer)