title: .NET Caching with AutoFac
body: <p>I am using AutoFac and have a custom caching implementation. When I register type of the Cached implementation, I configured the caching service as as a SingleInstance(). However, this prompts issues with the database connection (using EF) because the second concurrent request tries to access a closed connection. </p>
  
  <pre><code>Builder.RegisterType&lt;MyCachingDataService&gt;().As&lt;IMyCachingDataService&gt;().SingelInstance();
  </code></pre>
  
  <p>Hence we removed the SingleInstance() and made it default instance per call, now the issue is that it kind of defeats the purpose of caching if we do an instance per call, that way it is less performant.</p>
  
  <p>What is the way around this, what am I doing wrong.</p>