This folder in EasyCache.Core includes GetAndSet method.
GetAndSet
With this extension, the Get and Set methods work in pairs. If the cache is null, the given Func <T> will run and cached.
Get
Set
Func <T>
[HttpGet("[controller]/category")] public async Task<IActionResult> CategoryAsync() { var data = await easyCacheService.GetAndSet("getAndSet", () => GetData(), TimeSpan.FromSeconds(1)); return Ok(data); }
There was an error while loading. Please reload this page.
Contents:
Home
Getting Started
Customization