Click or drag to resize

CacheController.CacheResultset Method (CacheKey, String, TimeSpan, CachedResultset)

Caches the resultset specified under the key specified in the cache related to the connection string for the duration specified.

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.4.0.0 (5.4.0)
Syntax
public static void CacheResultset(
	CacheKey key,
	string connectionString,
	TimeSpan duration,
	CachedResultset toCache
)

Parameters

key
Type: SD.LLBLGen.Pro.ORMSupportClasses.CacheKey
The key.
connectionString
Type: System.String
The connection string the cache is registered under. Can be empty string. If null, the empty string is assumed
duration
Type: System.TimeSpan
The duration.
toCache
Type: SD.LLBLGen.Pro.ORMSupportClasses.CachedResultset
To cache.
Exceptions
ExceptionCondition
ArgumentNullExceptionkey
InvalidOperationExceptionif ThrowExceptionWhenCacheNotAvailable is set to true (default false) and no cache is found related to the specified connection string nor to the empty string
Remarks
If no cache is registered related to the connectionstring, this method is a no-op if ThrowExceptionWhenCacheNotAvailable is set to false (default), no caching takes place. Doesn't overwrite an existing resultset for key.
See Also