Async (.), and are fully await -able etc. In line with Microsoft’s naming guidance, the asynchronous methods all end. Note that all methods have both synchronous and asynchronous implementations. object: IDatabase cache connection.GetDatabase() Finally, the values can be set or. IDatabase db redis.GetDatabase(databaseNumber, asyncState) Once you have the IDatabase, it is simply a case of using the redis API.
Try using this code snippet, it worked for me: IServer server = Connection.GetServer(". NET Core one, by adding a NuGet package as StackExchange.redis. NET Redis clients can be found in the C section of the Redis Clients.
IDATABASE REDIS HOW TO
productKey 'product:' + productId IDatabase cache redisConnection. This article shows how to use StackExchange.Redis, a general purpose Redis client.
RedisKey keys = connection.GetServer(endPoint).Keys(pattern: "*").ToArray()The connection to your cache is managed by the RedisConnection class. Connect to the cache with RedisConnection. String connectionString = "my_connection_string" ĬonfigurationOptions options = ConfigurationOptions.Parse(connectionString) ĬonnectionMultiplexer connection = ConnectionMultiplexer.Connect(options) ĮndPoint endPoint = connection.GetEndPoints().First() Install-Package StackExchange.Redis The NuGet package downloads and adds the required assembly references for your client application to access Azure Cache for Redis with the StackExchange.Redis client. GetDatabase Returns a cheap pass-thru objects do not need to be stored (similar to static. Also ensure that you really need to get all keys, in my practice I've never ever needed this. Connecting a database: IDatabase db redis.GetDatabase(). However if you use redis 2.8+ - it will use SCAN command instead, which performs better. Note that prior to version 2.8 of redis server that will use KEYS command you mentioned, and it can be very slow in certain cases. Function that you need is under IServer interface, and can be reached with: ConnectionMultiplexer m = CreateConnection()