Skip to content

Commit c3405fb

Browse files
authored
Fix Redis usage sample code
This sample code was using the wrong variable to refer to the ConnectionMultiplexer object that is used for communicating with Redis. It is clear from the comments in the sample as well as the code snippet above this sample that the original intention was to use the "Connection" property instead of the private "lazyConnection" field.
1 parent 71aeaed commit c3405fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

articles/azure-cache-for-redis/cache-dotnet-how-to-use-azure-redis-cache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Add the following code for the `Main` procedure of the `Program` class for your
124124
{
125125
// Connection refers to a property that returns a ConnectionMultiplexer
126126
// as shown in the previous example.
127-
IDatabase cache = lazyConnection.Value.GetDatabase();
127+
IDatabase cache = Connection.GetDatabase();
128128

129129
// Perform cache operations using the cache object...
130130

0 commit comments

Comments
 (0)