18
Q:

c# .net core memory cache

private IMemoryCache cache;
public MyCacheController(IMemoryCache cache)
{    
        this.cache = cache;
}
0
[HttpGet]
public string Get()
{
    cache.Set(“MyKey”, DateTime.Now.ToString());
    return “This is a test method...”;
}
0
public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc();
    services.AddMemoryCache();
}
0

New to Communities?

Join the community