title: How to remove all objects (reset) from IMemoryCache in ASP.NET Core
body: <p>There is a <code>Remove</code> method to remove an object from <code>IMemoryCache</code> by its key. Is there a way to reset the whole cache and remove all objects?</p>
  <p>Using the <code>Dispose</code> method as stated by <a href="https://stackoverflow.com/questions/4183270/how-to-clear-the-net-4-memorycache">How to clear MemoryCache?</a> does not work:</p>
  <pre><code>ObjectDisposedException: Cannot access a disposed object.
   Object name: 'Microsoft.Extensions.Caching.Memory.MemoryCache'.
  </code></pre>