Skip to content

mtmk/simple-cache-manager

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
March 11, 2015 16:06
March 11, 2015 16:03
March 11, 2015 23:19
March 11, 2015 16:06

Simple Cache Manager .Net

Build status

This is a very simple cache manager example with expiration. It is a thin wrapper around a dictionary.

var cacheManager = new CacheManager<string>();

cacheManager.Add("key1", "value1", DateTime.UtcNow, TimeSpan.FromSeconds(300));
cacheManager.Add("key2", "value2", DateTime.UtcNow, TimeSpan.FromSeconds(600));

Assert.True(cacheManager.Contains("key1"));
Assert.True(cacheManager.Contains("key1"));

Assert.Equal("value1", cacheManager.GetData("key1"));
Assert.Equal("value1", cacheManager.GetData("key1"));

Enjoy

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages