Chili.Opf3 Send comments on this topic.
CacheManager Property
See Also  Example
Chili.Opf3 Namespace > ObjectContext Class : CacheManager Property




Specifies the class that implements the ICacheManager interface.

Syntax

Visual Basic (Declaration) 
Public Property CacheManager As ICacheManager
Visual Basic (Usage)Copy Code
Dim instance As ObjectContext
Dim value As ICacheManager
 
instance.CacheManager = value
 
value = instance.CacheManager
C# 
public ICacheManager CacheManager {get; set;}
Managed Extensions for C++ 
public: __property ICacheManager* get_CacheManager();
public: __property void set_CacheManager( 
   ICacheManager* value
);
C++/CLI 
public:
property ICacheManager^ CacheManager {
   ICacheManager^ get();
   void set (ICacheManager^ value);
}

Return Value

Returns the ICacheManager of the ObjectContext or null if no manager has been specified.

Example

The following example shows how to set the SimpleCacheManager.
C#Copy Code
// Creates a new ObjectContext that uses an MsSql Server as storage. 
ObjectContext context = new ObjectContext(new MsSqlStorage("sa", "",  
    "localhost", "application")); 
// Set the CacheManager. 
context.CacheManager = new SimpleCacheManager(); 
    

Remarks

The ICacheManager holds instances of created persistent objects as long as they do not expire. If the cache contains still an instance of a persistent object and the object is to be reloaded the cached instance is re-used.

Requirements

Platforms: Windows 2000, Windows XP family, Windows Server 2003 family, Windows Vista family

See Also