ObjectCache.Contains(String, String) Method

Definition

When overridden in a derived class, checks whether the cache entry already exists in the cache.

C#
public abstract bool Contains(string key, string regionName = default);

Parameters

key
String

A unique identifier for the cache entry.

regionName
String

Optional. A named region in the cache where the cache can be found, if regions are implemented. The default value for the optional parameter is null.

Returns

true if the cache contains a cache entry with the same key value as key; otherwise, false.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)