Edit

Share via


LRUCache<TKey,TValue>.Item[TKey] Property

Definition

Retrieves or sets value in the LRU cache

public TValue this[TKey key] { get; set; }
member this.Item('Key) : 'Value with get, set

Parameters

key
TKey

Key to lookup

Property Value

TValue

Remarks

When getting a value, it will returns null if the value was not found on the cache.

When setting a value if the key was already in the cache, the entry is flagged as recently used. If not, the key is added as the most recently used key. Adding a new key to the cache might cause existing values in the cache to be Disposed, either because of the limit of active entries has been exceeded or because the total amount of byte has been exceeded.

Applies to