Language

Cache.Put Method (String, String, Object)

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

Adds a new object to the cache or replaces one if it already occurs in the cache. This overload allows you to save your object to a region.

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

Syntax

'Declaration
Public Function Put ( _
    region As String, _
    key As String, _
    value As Object _
) As CacheItemVersion
'Usage
Dim instance As Cache
Dim region As String
Dim key As String
Dim value As Object
Dim returnValue As CacheItemVersion

returnValue = instance.Put(region, key, value)
public CacheItemVersion Put (
    string region,
    string key,
    Object value
)
public:
CacheItemVersion^ Put (
    String^ region, 
    String^ key, 
    Object^ value
)
public CacheItemVersion Put (
    String region, 
    String key, 
    Object value
)
public function Put (
    region : String, 
    key : String, 
    value : Object
) : CacheItemVersion

Parameters

  • region
    The region where the object is stored. Use DefaultRegion if the object is not stored in a region.
  • key
    The unique value that is used to identify the object in the region or cache. If this parameter is null, an exception is thrown.
  • value
    The object saved to the cache cluster.

Return Value

A CacheItemVersion object that represents the version of the object saved to the cache in the key value.

Remarks

This method resembles the Add method, but it does not throw an exception if an object has already been cached by using the same key. For more information about how to use this method, see How to: Update an Object in Cache (Velocity).

See Also

Reference

Cache Class
Cache Members
System.Data.Caching Namespace