public Task <TResult> Set(TKey key, Task <TResult> task)
 {
     _cachedTasks[key] = task;
     _setDates[key]    = CurrentTimeProvider.GetCurrent();
     return(task);
 }
        private bool IsKeyExpired(TKey key)
        {
            DateTimeOffset setDate;

            return(Expiration.HasValue && _setDates.TryGetValue(key, out setDate) && setDate.Add(Expiration.Value) < CurrentTimeProvider.GetCurrent());
        }