public void Set <T>(CacheItemList <T> items) where T : class { if (items == null || !items.Data.Any()) { return; } var expiresIn = items.ExpiresIn; TimeSpan timeSpan; if (!expiresIn.HasValue) { var expiresAt = items.ExpiresAt; // ISSUE: explicit reference operation // ISSUE: variable of a reference type var local = expiresAt; // ISSUE: explicit reference operation // ISSUE: explicit reference operation timeSpan = local?.Subtract(DateTimeOffset.Now) ?? _defaultCacheTime; } else { timeSpan = expiresIn.GetValueOrDefault(); } var absoluteExpirationRelativeToNow = timeSpan; foreach (var tuple in items.Data) { // ISSUE: variable of a boxed type Cache.Set(tuple.Item1, tuple.Item2, absoluteExpirationRelativeToNow); } }
public Task SetAsync <T>(CacheItemList <T> items) where T : class => Client.AddAllAsync(items.Data, items.ExpiresAt, items.ExpiresIn, items.FireAndForget);
public void Set <T>(CacheItemList <T> items) where T : class => Client.AddAll(items.Data, items.ExpiresAt, items.ExpiresIn, items.FireAndForget);
public Task SetAsync <T>(CacheItemList <T> items) where T : class => _asyncPolicy.ExecuteAsync(() => _cacheManager.SetAsync(items));
public void Set <T>(CacheItemList <T> items) where T : class => _syncPolicy.Execute(() => _cacheManager.Set(items));
public Task SetAsync <T>(CacheItemList <T> items) where T : class { Set(items); return(Task.FromResult(true)); }