-
Notifications
You must be signed in to change notification settings - Fork 3
Extensions
Furkan Güngör edited this page Jan 2, 2021
·
1 revision
This folder in EasyCache.Core includes GetAndSet
method.
With this extension, the Get
and Set
methods work in pairs. If the cache is null, the given Func <T>
will run and cached.
[HttpGet("[controller]/category")]
public async Task<IActionResult> CategoryAsync()
{
var data = await easyCacheService.GetAndSet("getAndSet", () => GetData(), TimeSpan.FromSeconds(1));
return Ok(data);
}
Contents:
-
Home
-
Getting Started
-
Customization