Class ApplicationCache
An ITokenCache that stores the tokens in the cache designated by CacheName
(the default cache when the name is empty or unknown). The keys are lower-cased and suffixed with _TokenCache.
[Export(typeof(ITokenCache))]
[Shared]
public class ApplicationCache : ITokenCache
- Inheritance
-
ApplicationCache
- Implements
- Inherited Members
Constructors
ApplicationCache(ICacheHelper, ILogger, IOptions<TokenCacheOptions>)
An ITokenCache that stores the tokens in the cache designated by CacheName
(the default cache when the name is empty or unknown). The keys are lower-cased and suffixed with _TokenCache.
public ApplicationCache(ICacheHelper cacheHelper, ILogger logger, IOptions<TokenCacheOptions> options)
Parameters
cacheHelperICacheHelperloggerILoggeroptionsIOptions<TokenCacheOptions>
Methods
DeleteItem(string)
Removes the entry stored for the key. The claims cached by the claims filler are stored under another key and are not removed.
public void DeleteItem(string key)
Parameters
keystringThe key of the token.
GetAll()
Not supported.
public IEnumerable<byte[]> GetAll()
Returns
- IEnumerable<byte[]>
Never returns.
Exceptions
- NotImplementedException
Always thrown.
Get<T>(string)
Gets a value.
public T? Get<T>(string key)
Parameters
keystringThe unique key.
Returns
- T
The value, or the default of
Twhen there is none.
Type Parameters
TThe type of the value.
Put<T>(string, T)
Adds or replaces a value.
public void Put<T>(string key, T data)
Parameters
keystringThe unique key.
dataTThe value to store. A null value is ignored by some implementations.
Type Parameters
TThe type of the value.