Beispiel #1
0
 private string GetCacheKey(GetExchangeRates request) => $"{nameof(GetExchangeRates)}-{request.Date}";
Beispiel #2
0
 public Task <IEnumerable <ExchangeRate> > Handle(GetExchangeRates request, CancellationToken cancellationToken)
 {
     return(Task.FromResult(_appCache.GetOrAdd(GetCacheKey(request), () => Query(request.Date), DateTimeOffset.Now.AddHours(8))));
 }