Show / Hide Table of Contents

Class UserValueCache

Default implementation of IUserValueCache. This is a simple in memory cache that is not shared between servers.

Inheritance
object
UserValueCache
Implements
IUserValueCache
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Cache
Assembly: SoCore.dll
Syntax
public class UserValueCache : IUserValueCache

Constructors

UserValueCache()

Default implementation of IUserValueCache. This is a simple in memory cache that is not shared between servers.

Declaration
public UserValueCache()

Methods

ClearCachedItem(int, string)

Clear a cached value for the given associate.

Declaration
public 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
public void ClearValues(int associateId)
Parameters
Type Name Description
int associateId

SetCachedItem<TItem>(int, string, TItem, TimeSpan)

Cache an item for the given associate.

Declaration
public 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
public 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

Implements

IUserValueCache

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top