Table of Contents

TryGet Method

Definition

Namespace
Cuemon.Runtime.Caching
Assemblies
Cuemon.Runtime.Caching.dll
Source
src/Cuemon.Runtime.Caching/SlimMemoryCache.cs

TryGet(string, out object)

Attempts to get the value associated with the specified key from the cache.

public bool TryGet(string key, out object value)

Parameters

key string

The unique identifier for the cache entry.

value object

When this method returns, contains the value associated with the specified key, or null if the operation failed.

Returns

bool

true if the value was found in the cache; otherwise, false.

TryGet(string, string, out object)

Attempts to get the value associated with the specified key and ns from the cache.

public bool TryGet(string key, string ns, out object value)

Parameters

key string

The unique identifier for the cache entry.

ns string

The optional namespace that provides a scope to the cache.

value object

When this method returns, contains the value associated with the specified key and ns, or null if the operation failed.

Returns

bool

true if the value was found in the cache; otherwise, false.

Exceptions

ArgumentNullException

key cannot be null.