Skip to content

Instantly share code, notes, and snippets.

@csharpfritz csharpfritz/HomeController.cs Secret
Created Jun 27, 2016

Embed
What would you like to do?
ASP.NET Core Distributed Cache usage
public HomeController(IDistributedCache cache) {
this.Cache = cache;
}
public IDistributedCache Cache { get; private set; }
public IActionResult Index() {
ViewBag.CachedValue = Cache.Get("myCacheKey");
return View();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.