title: Dictionary Cache with expiration time
body: <p>I want to create a class to return a value. This value will be cached in a dictionary object for 2 minutes. During these 2 minutes I need to return the cached value, after those  minutes the dictionary cache object should read the value again. I need to use the Dictionary object not memorychache or something and I should execute the code in Test method class not a windows form or wpf. </p>
  
  <p>I don't know how to make the dictionary object expired after 2 minutes in a test method.</p>
  
  <pre><code>public class CacheClass
  {
     public string GetValue()
     {
        Dictionary&lt;int, string&gt; Cache = new Dictionary&lt;int, string&gt;();
        string value1 = "Lina";
        string value2 = "Jack";
  
        return "cached value";
     }
  }
  </code></pre>