InMemoryCacheClient

Namespace: ASPSecurityKit
Assembly: ASPSecurityKit.dll

Summary

Provides an in-memory implementation of ICacheClient.

Methods

Get<T>(key)

Summary

Gets the value from the cache storage by the specified key.

Returns

The value from the cache storage by the specified key.

Parameters
Name Type Description
key System.String The key.
Generic Types
Name Description
T The type of the value.

GetAsync<T>(key)

Summary

Gets the value from the cache storage by the specified key.

Returns

The value from the cache storage by the specified key.

Parameters
Name Type Description
key System.String The key.
Generic Types
Name Description
T The type of the value.

GetAsync<T>(key,cancellationToken)

Summary

Gets the value from the cache storage by the specified key.

Returns

The value from the cache storage by the specified key.

Parameters
Name Type Description
key System.String The key.
cancellationToken System.Threading.CancellationToken The cancellation token.
Generic Types
Name Description
T The type of the value.

Set<T>(key,obj,expireAfter)

Summary

Sets the value in the cache storage for the specified key.

Parameters
Name Type Description
key System.String The key.
obj T The value.
expireAfter System.Nullable{System.TimeSpan} The interval after which the cached data should expire (can be removed from the cache).
Generic Types
Name Description
T The type of the value.
Remarks

If expireAfter isn’t specified, the default expiration of one day is assumed.

SetAsync<T>(key,obj,expireAfter)

Summary

Sets the value in the cache storage for the specified key.

Parameters
Name Type Description
key System.String The key.
obj T The value.
expireAfter System.Nullable{System.TimeSpan} The interval after which the cached data should expire (can be removed from the cache).
Generic Types
Name Description
T The type of the value.
Remarks

If expireAfter isn’t specified, the default expiration of one day is assumed.

SetAsync<T>(key,obj,cancellationToken,expireAfter)

Summary

Sets the value in the cache storage for the specified key.

Parameters
Name Type Description
key System.String The key.
obj T The value.
cancellationToken System.Threading.CancellationToken The cancellation token.
expireAfter System.Nullable{System.TimeSpan} The interval after which the cached data should expire (can be removed from the cache).
Generic Types
Name Description
T The type of the value.
Remarks

If expireAfter isn’t specified, the default expiration of one day is assumed.