Changed AzureOutputCacheStorageProvider to return empty list when asked to enumerate cache contents (instead of throwing NotImplementedException as before).

This commit is contained in:
Daniel Stolt
2013-08-27 04:14:22 +02:00
committed by Sebastien Ros
parent 687fdadccc
commit ea3d926095

View File

@@ -89,7 +89,7 @@ namespace Orchard.Azure.Services.Caching.Output {
public IEnumerable<CacheItem> GetCacheItems(int skip, int count) {
if (_usingSharedCaching)
throw new NotSupportedException("The GetCacheItems() method is not supported with Windows Azure Shared Caching.");
return Enumerable.Empty<CacheItem>(); // Enumeration not supported with Shared Caching.
return _cache.GetObjectsInRegion(_region).AsParallel()
.Select(x => x.Value)
@@ -101,7 +101,7 @@ namespace Orchard.Azure.Services.Caching.Output {
public int GetCacheItemsCount() {
if (_usingSharedCaching)
throw new NotSupportedException("The GetCacheItemsCount() method is not supported with Windows Azure Shared Caching.");
return 0; // Enumeration not supported with Shared Caching.
return _cache.GetObjectsInRegion(_region).AsParallel()
.Select(x => x.Value)