Language

Cache.Put Method (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 is already located in the cache. The object is not stored in a region when this overload is used.

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

Syntax

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

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

Parameters

  • key
    The unique value that is used to identify the object in the 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 under 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