Class CPCacheBaseClass
- Namespace
- Contensive.BaseClasses
- Assembly
- CPBase.dll
CP.Cache - local and remote caching
public abstract class CPCacheBaseClass
- Inheritance
-
CPCacheBaseClass
- Inherited Members
Methods
Clear(List<string>)
Invalidate one or more cache objects by key
public abstract void Clear(List<string> keyList)
Parameters
Clear(string)
Use Clear(dependentKeyList)
[Obsolete("Use Clear(dependentKeyList)", false)]
public abstract void Clear(string ContentNameList)
Parameters
ContentNameListstring
ClearAll()
Invalidate all system cache.
public abstract void ClearAll()
CreateDependencyKeyInvalidateOnChange(string)
use CreateTabledependencyKey() instead
[Obsolete("use CreateTabledependencyKey() instead", false)]
public abstract string CreateDependencyKeyInvalidateOnChange(string tablename)
Parameters
tablenamestring
Returns
CreateDependencyKeyInvalidateOnChange(string, string)
use CreateTabledependencyKey() instead
[Obsolete("use CreateTabledependencyKey() instead", false)]
public abstract string CreateDependencyKeyInvalidateOnChange(string tablename, string datasource)
Parameters
Returns
CreateKey(string)
Createconvert a unique name to a cache key
public abstract string CreateKey(string uniqueName)
Parameters
uniqueNamestring
Returns
CreateKey(string, string)
deprecated. Use CreateKey( uniqueName )
public abstract string CreateKey(string uniqueName, string objectUniqueIdentifier)
Parameters
Returns
CreateKeyForDbRecord(int, string)
use CreateRecordKey() instead
[Obsolete("use CreateRecordKey() instead", false)]
public abstract string CreateKeyForDbRecord(int recordId, string tableName)
Parameters
Returns
CreateKeyForDbRecord(int, string, string)
use CreateRecordKey() instead
[Obsolete("use CreateRecordKey() instead", false)]
public abstract string CreateKeyForDbRecord(int recordId, string tableName, string dataSourceName)
Parameters
Returns
CreatePtrKeyforDbRecordGuid(string, string)
Create a cachKeyPointer for a db model object.
public abstract string CreatePtrKeyforDbRecordGuid(string guid, string tableName)
Parameters
Returns
CreatePtrKeyforDbRecordGuid(string, string, string)
Create a pointer cacheKey for a db model object. A Ptr key doesnt contain the object, but points to a key for an object. When you get a cache object from a Ptr Key, the object it points to is returned. For example, data may be stored in a cache named for the id of a record, then a pointer created for the guid of the record.
public abstract string CreatePtrKeyforDbRecordGuid(string guid, string tableName, string dataSourceName)
Parameters
Returns
CreatePtrKeyforDbRecordUniqueName(string, string)
Create a Ptr key for a db model object based on the record name.
public abstract string CreatePtrKeyforDbRecordUniqueName(string name, string tableName)
Parameters
Returns
CreatePtrKeyforDbRecordUniqueName(string, string, string)
Create a Ptr key for a db model object based on the record name. Only for tables where the name is unique
public abstract string CreatePtrKeyforDbRecordUniqueName(string name, string tableName, string dataSourceName)
Parameters
Returns
CreateRecordKey(int, string)
Create a cacheKey for a database record in the default datasource. A cacheKey argument is required for many cache methods.
public abstract string CreateRecordKey(int recordId, string tableName)
Parameters
Returns
CreateRecordKey(int, string, string)
Create a cacheKey for a database model object. A cacheKey argument is required for many cache methods.
public abstract string CreateRecordKey(int recordId, string tableName, string dataSourceName)
Parameters
Returns
CreateTableDependencyKey(string)
Create a dependency cacheKey for a database table. Use a dependency cacheKey as an argument in setCache(). If any record is updated in this table, any cache that includes this dependency will be invalidated
public abstract string CreateTableDependencyKey(string tableName)
Parameters
tableNamestring
Returns
CreateTableDependencyKey(string, string)
Create a key used only as a dependency. If any record in the table is added/deleted/modified, this key will be updated, invalidating the parent object. Uses UpdateLastModified Uses the
public abstract string CreateTableDependencyKey(string tableName, string dataSourceName)
Parameters
Returns
GetBoolean(string)
Return a boolean from cache. If empty or invalid, returns false.
public abstract bool GetBoolean(string key)
Parameters
keystring
Returns
GetDate(string)
Return a date from cache. If empty or invalid, returns Date.MinValue.
public abstract DateTime GetDate(string key)
Parameters
keystring
Returns
GetInteger(string)
Return an integer from cache. If empty or invalid, returns 0.
public abstract int GetInteger(string key)
Parameters
keystring
Returns
GetNumber(string)
Return a double from cache. If empty or invalid, returns 0.
public abstract double GetNumber(string key)
Parameters
keystring
Returns
GetObject(string)
Return the value of a cache. If empty or invalid, returns null.
public abstract object GetObject(string key)
Parameters
keystring
Returns
GetObject<T>(string)
Get an object of type T from cache. If empty or invalid type, returns Null.
public abstract T GetObject<T>(string key)
Parameters
keystring
Returns
- T
Type Parameters
T
GetText(string)
Return a string from cache. If empty or invalid, returns empty string.
public abstract string GetText(string key)
Parameters
keystring
Returns
Invalidate(string)
Invalidate a cache.
public abstract void Invalidate(string key)
Parameters
keystring
InvalidateAll()
Invalidate all system cache.
public abstract void InvalidateAll()
InvalidateContentRecord(string, int)
Invalidate a key based on the content name and recordId
public abstract void InvalidateContentRecord(string contentName, int recordId)
Parameters
InvalidateTable(string)
Invalidate all cache entries dependent on this tableKey
public abstract void InvalidateTable(string tableName)
Parameters
tableNamestring
InvalidateTableRecord(string, int)
Invalidate a key based on the table and recordId
public abstract void InvalidateTableRecord(string tableName, int recordId)
Parameters
InvalidateTag(string)
Use Invalidate(key)
[Obsolete("Use Invalidate(key)", false)]
public abstract void InvalidateTag(string tag)
Parameters
tagstring
InvalidateTagList(List<string>)
Invalidate a list of cache keys.
public abstract void InvalidateTagList(List<string> keyList)
Parameters
Read(string)
Use GetText(key) instead
[Obsolete("Use GetText(key) instead", false)]
public abstract string Read(string key)
Parameters
keystring
Returns
Save(string, string)
Use Store()
[Obsolete("Deprecated. Use Store().", false)]
public abstract void Save(string key, string Value)
Parameters
Save(string, string, string)
Use Store()
[Obsolete("Deprecated. Use Store().", false)]
public abstract void Save(string key, string Value, string tagCommaList)
Parameters
Save(string, string, string, DateTime)
Use Store()
[Obsolete("Deprecated. Use Store().", false)]
public abstract void Save(string key, string Value, string tagCommaList, DateTime ClearOnDate)
Parameters
SetKey(string, object)
[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value)
Parameters
SetKey(string, object, List<string>)
Deprecated. Use Store().
[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value, List<string> tagList)
Parameters
SetKey(string, object, DateTime)
Deprecated. Use Store().
[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value, DateTime invalidationDate)
Parameters
SetKey(string, object, DateTime, List<string>)
Deprecated. Use Store().
[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value, DateTime invalidationDate, List<string> tagList)
Parameters
SetKey(string, object, DateTime, string)
Deprecated. Use Store().
[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value, DateTime invalidationDate, string tag)
Parameters
SetKey(string, object, string)
Deprecated. Use Store().
[Obsolete("Deprecated. Use Store().", false)]
public abstract void SetKey(string key, object Value, string tag)
Parameters
Store(string, object)
Store an object to a key.
public abstract void Store(string key, object value)
Parameters
Store(string, object, List<string>)
Store an object to a key. Invalidate the object if a dependentKey is updated after this object is stored.
public abstract void Store(string key, object value, List<string> dependentKeyList)
Parameters
Store(string, object, DateTime)
Store an object to a key. Invalidate at the date and time specified.
public abstract void Store(string key, object value, DateTime invalidationDate)
Parameters
Store(string, object, DateTime, List<string>)
Store an object to a key. Invalidate at the date and time specified.
public abstract void Store(string key, object value, DateTime invalidationDate, List<string> dependentKeyList)
Parameters
Store(string, object, DateTime, string)
Store an object to a key.
public abstract void Store(string key, object value, DateTime invalidationDate, string dependentKey)
Parameters
Store(string, object, string)
Store an object to a key. Invalidate the object if a dependentKey is updated after this object is stored.
public abstract void Store(string key, object value, string dependentKey)
Parameters
StorePtr(string, string)
Store a ptr to a cache entry. For example you may store an object by its recordId, but need to reference it by its guid. Create the cache key with the id, and a cache ptr which refers the guid to the cacheKey and a Get of the ptr will return the cache entry for the id.
public abstract void StorePtr(string keyPtr, string key)
Parameters
UpdateLastModified(string)
Use InvalidateTableDependencyKey() instead
[Obsolete("Use InvalidateTableDependencyKey() instead", false)]
public abstract void UpdateLastModified(string tableName)
Parameters
tableNamestring
invalidateTableDependencyKey(string)
Invalidate all cache objects created with CreateRecordKey() and including this tableName
public abstract void invalidateTableDependencyKey(string tableName)
Parameters
tableNamestring