ConversionCache<TKey, TValue>.

Convert(TKey) Method

Summary

If a value has already been cached for the specified `key`, return it. Otherwise create a new one using the delegate provided in the constructor and cache it.

If the `key` is null, this method returns the default TValue.

Syntax

public TValue Convert(TKey key)

Remarks

This method also periodically removes values that have not been used recently.

Parameters

Name Type Description
key TKey

Return Value

Type Description
TValue