DataCacheFactory.GetCache Method

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Returns the cache client, an instance of the DataCache object.

Namespace: Microsoft.Data.Caching
Assembly: ClientLibrary (in clientlibrary.dll)

Syntax

'Declaration
Public Function GetCache ( _
    cacheName As String _
) As DataCache
'Usage
Dim instance As DataCacheFactory
Dim cacheName As String
Dim returnValue As DataCache

returnValue = instance.GetCache(cacheName)
public DataCache GetCache (
    string cacheName
)
public:
DataCache^ GetCache (
    String^ cacheName
)
public DataCache GetCache (
    String cacheName
)
public function GetCache (
    cacheName : String
) : DataCache

Parameters

  • cacheName
    The named cache to use for cache operations.

Return Value

The cache client, an instance of the DataCache object.

Remarks

Before working with the cache, you must instantiate the DataCacheFactory class.

The cache client returned by this method can be configured programmatically, or by the application configuration file. When configuration parameters are passed to the DataCacheFactory class constructor, those configuration settings are used for all cache clients obtained from that DataCacheFactory object. Configuration parameters passed to the constructor override settings specified in the application configuration file. If no parameters are provided to the DataCacheFactory class constructor, the cache client configuration parameters come from the application configuration file. For more information about configuration options and settings for the cache client, see Configuration (Velocity).

Note

Before working with the cache, you must first create the named cache with the New-Cache command of the PowerShell based cache administration tool. Cache names are case sensitive; make sure that the case of the specified cache is the same as shown with the Get-Cache command. Use the Get-Cache command with to find out which caches are present in the cluster. For more information, see Cache Administration with PowerShell (Velocity).

See Also

Reference

DataCacheFactory Class
DataCacheFactory Members
Microsoft.Data.Caching Namespace