Check out example codes for "c# .net core memory cache". It will help you in understanding the concepts better.

Code Example 1

public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc();
    services.AddMemoryCache();
}

Code Example 2

[HttpGet]
public string Get()
{
    cache.Set(“MyKey”, DateTime.Now.ToString());
    return “This is a test method...”;
}

Code Example 3

private IMemoryCache cache;
public MyCacheController(IMemoryCache cache)
{    
        this.cache = cache;
}

Learn ReactJs, React Native from akashmittal.com