Table of Contents

Method GetOrCreateCached

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetOrCreateCached(TKey, Func<TValue>)

Gets the value associated with the specified key. If the key is not found in the dictionary, it is added there with the value provided by func.

public TValue GetOrCreateCached(TKey key, Func<TValue> func)

Parameters

key TKey

The key of the value to get.

func Func<TValue>

Value provider function.

Returns

TValue

Remarks

This function uses value of the LastItem property to speed up its work.