Interface IUserValueCache
Namespace: SuperOffice.CRM.Cache
Assembly: SoCore.dll
Syntax
public interface IUserValueCache
Methods
ClearCachedItem(int, string)
Clear a cached value for the given associate.
Declaration
void ClearCachedItem(int associateId, string cacheKey)
Parameters
Type | Name | Description |
---|---|---|
int | associateId | Associate id of the user to cache value for. |
string | cacheKey | Key to use for the cached item |
ClearValues(int)
Clear all cached values for the given associate.
Declaration
void ClearValues(int associateId)
Parameters
Type | Name | Description |
---|---|---|
int | associateId |
SetCachedItem<TItem>(int, string, TItem, TimeSpan)
Cache an item for the given associate.
Declaration
void SetCachedItem<TItem>(int associateId, string cacheKey, TItem value, TimeSpan duration)
Parameters
Type | Name | Description |
---|---|---|
int | associateId | Associate id of the user to cache for |
string | cacheKey | Key to use for the cache |
TItem | value | Value to cache |
TimeSpan | duration | Duration the value is cached for. |
Type Parameters
Name | Description |
---|---|
TItem | Type of value cache |
TryGetCachedItem<TItem>(int, string, out TItem)
Try to get a cached item for the given associate. Value must be of matching type and can not be expired
Declaration
bool TryGetCachedItem<TItem>(int associateId, string cacheKey, out TItem item)
Parameters
Type | Name | Description |
---|---|---|
int | associateId | Associate id of the user to cache value for. |
string | cacheKey | Key to use for the cached item |
TItem | item | item to retrieve from the cache |
Returns
Type | Description |
---|---|
bool | True if a value that has not been expired is found |
Type Parameters
Name | Description |
---|---|
TItem | Type of value to cache |