I'm using the default MemoryCache
, which works fine for my purposes. However the GetValues()
method returns IDictionary<string, object>
Is there a quick way to cast this to IDictionary<string, MyType>
?
Use ToDictionary
:
ToDictionary(k => k.Key, k => (MyType)k.Value)