Skip to content

Instantly share code, notes, and snippets.

@devdays
Created February 5, 2015 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/35c614d14c80a606c59a to your computer and use it in GitHub Desktop.
Save devdays/35c614d14c80a606c59a to your computer and use it in GitHub Desktop.
Redis Cache from .NET
IDatabase cache = Connection.GetDatabase();
// Perform cache operations using the cache object...
// Simple put of integral data types into the cache
cache.StringSet("key1", "value");
cache.StringSet("key2", 25);
// Simple get of data types from the cache
string key1 = cache.StringGet("key1");
int key2 = (int)cache.StringGet("key2");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment