Created
November 23, 2018 10:59
-
-
Save ngohungphuc/6e08c6518142217eb02c9ed74bacfae0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IMemoryCache memoryCache; | |
public HomeController(IMemoryCache memoryCache) | |
{ | |
this.memoryCache = memoryCache; | |
} | |
public IActionResult Index() | |
{ | |
if (!this.memoryCache.TryGetValue(ExampleGuidService.ExampleGuidsKey, out List<ExampleGuid> cacheEntry)) | |
{ | |
cacheEntry = new List<ExampleGuid>(); | |
} | |
return View(cacheEntry); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment