Last active
February 10, 2021 16:49
-
-
Save woeterman94/06808efa4e618a738327c24f65e43700 to your computer and use it in GitHub Desktop.
memorycache
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 async Task<IEnumerable<SupplyResponse>> GetSupplyWithCacheAsync() | |
{ | |
return await _memoryCache.GetOrCreateAsync<IEnumerable<SupplyResponse>>(CacheKeys.ShopSupply, async cache => | |
{ | |
cache.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(30); | |
return await GetWebshopSupply(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment