title: How to disable MemoryCache in Entity Framework Core?
body: <p>I have this code on my Startup.</p>
  
  <pre><code>var connection = Configuration.GetConnectionString("DefaultConnection")?.Replace("[BD_PASS]", Environment.GetEnvironmentVariable("BD_PASS"));
  services.AddDbContext&lt;BdContext&gt;(options =&gt; options.UseSqlServer(connection));
  
  services.AddMemoryCache(op =&gt;
              {
                  op.SizeLimit = int.Parse(Environment.GetEnvironmentVariable("CACHE_SIZE_LIMIT") ?? "10");
              });
  </code></pre>
  
  <p>The problem is that I wasn't aware that Entity Framework Core would intercept my queries against the database. So, I am getting a</p>
  
  <pre><code> _context.Product.ToList();
  </code></pre>
  
  <p>But I am getting this message when the code above is run.</p>
  
  <blockquote>
    <p>cache entry must specify a value for size when the size limit is set</p>
  </blockquote>
  
  <p>Is there anything I could do at the configuration level to say "Hey EFC, don't you bother to cache anything."</p>