コード例 #1
0
ファイル: GeolocationService.cs プロジェクト: KevinTss/nyss
 public async Task <Result <LocationDto> > GetLocationFromCountry(string country) =>
 await _inMemoryCache.GetCachedResult(
     key : $"Geolocation_Country_{country}",
     validFor : TimeSpan.FromDays(1),
     value : () => FetchLocationFromCountry(country));
コード例 #2
0
ファイル: AppDataController.cs プロジェクト: KevinTss/nyss
 public async Task <Result <IDictionary <string, string> > > GetStrings(string languageCode) =>
 await _inMemoryCache.GetCachedResult(
     $"{nameof(GetStrings)}.{languageCode}",
     TimeSpan.FromMinutes(5),
     () => _stringsResourcesService.GetStringsResources(languageCode));