Friday, May 8, 2020

.NET Framework Caching

Assuming at the top of a Controller...

private readonly ICacher _cacher;

 
 

...then...

_cacher.AddtoCache("foo", "bar");

 
 

...then...

var meh = _cacher.GetValue("foo");

 
 

...then...

_cacher.FlushKeys();

 
 

...then...

var deleted = _cacher.DeleteKey(id);

 
 

...then...

var authItems = _cacher.GetValue(CacheItems.AuthorizationItems) as
      AuthorizationCacheItem;

No comments:

Post a Comment