Created
October 14, 2020 12:36
-
-
Save umayeras/07d2556a08a6d769b90652d295017e81 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
public async Task<IEnumerable<Sample>> GetAll() | |
{ | |
if (cachingService.Exists(CacheKey.Samples)) | |
{ | |
return cachingService.Get<IEnumerable<Sample>>(CacheKey.Samples); | |
} | |
var list = await repository.GetAllAsync(); | |
cachingService.Set(CacheKey.Samples, samples.ToList()); | |
return list; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment