Adds an entry using key and value pair into the cache, and returns an existing cache entry with a matching key.
public virtual T AddOrGetExisting<T>(
string key,
T value,
CacheItemPolicy policy,
string regionName
)
key
Unique identifier of the cache item.
value
Data for the cache item.
policy
Expiration policy for the item.
regionName
Optional name of a region in cache.
The previous cache entry that matches the specified key, if found. If the cache contains an item with the same key, then it will be returned before it is overwritten. Otherwise, null.