title: Looking for a very simple Cache example
body: <p>I'm looking for a real simple example of how to add an object to cache, get it back out again, and remove it.</p>
  
  <p>The second answer <a href="https://stackoverflow.com/questions/2458205/simple-c-sharp-asp-net-cache-implementation">here</a> is the kind of example I'd love to see...</p>
  
  <pre><code>List&lt;object&gt; list = new List&lt;Object&gt;();
  
  Cache["ObjectList"] = list;                 // add
  list = ( List&lt;object&gt;) Cache["ObjectList"]; // retrieve
  Cache.Remove("ObjectList");                 // remove
  </code></pre>
  
  <p>But when I try this, on the first line I get:</p>
  
  <blockquote>
    <p>'Cache' is a type, which is not valid in the given context.  </p>
  </blockquote>
  
  <p>And on the third line I get:</p>
  
  <blockquote>
    <p>An object method is required for the non-static field blah blah blah</p>
  </blockquote>
  
  <p>So, let's say I have a <code>List&lt;T&gt;</code>...</p>
  
  <pre><code>var myList = GetListFromDB()
  </code></pre>
  
  <p>And now I just wanna add <code>myList</code> to the cache, get it back out, and remove it.</p>