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