Last active
April 2, 2021 10:50
-
-
Save sajadkardel/a6047b1c2d9b014ca1d3b5d1da4dbbb6 to your computer and use it in GitHub Desktop.
Cache in Asp.Net Core Article
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
public IActionResult GetOrCreate() | |
{ | |
var data = _cache.GetOrCreate( "CacheKey" , entry => | |
entry.SlidingExpiration = TimeSpan.FromSeconds(3); | |
return View(data); | |
}); | |
return View(data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment