Exemple #1
0
 public async Task <Result <LocationDto> > GetLocationFromCountry(string country) =>
 await _inMemoryCache.GetCachedResult(
     key : $"Geolocation_Country_{country}",
     validFor : TimeSpan.FromDays(1),
     value : () => FetchLocationFromCountry(country));
Exemple #2
0
 public async Task <Result <IDictionary <string, string> > > GetStrings(string languageCode) =>
 await _inMemoryCache.GetCachedResult(
     $"{nameof(GetStrings)}.{languageCode}",
     TimeSpan.FromMinutes(5),
     () => _stringsResourcesService.GetStringsResources(languageCode));