Simplified the base cache provider, no generics, these will be taken care of by extensions

This commit is contained in:
Shannon
2013-08-08 20:25:26 +10:00
parent 8c55946b1b
commit 8fea9530b5
10 changed files with 120 additions and 107 deletions

View File

@@ -36,15 +36,12 @@ namespace Umbraco.Core.Cache
}
}
public override T GetCacheItem<T>(string cacheKey, Func<T> getCacheItem)
public override object GetCacheItem(string cacheKey, Func<object> getCacheItem)
{
var ctx = _context();
var ck = GetCacheKey(cacheKey);
if (ctx.Items[ck] == null)
{
ctx.Items[ck] = getCacheItem();
}
return (T)ctx.Items[ck];
return ctx.Items[ck] ?? (ctx.Items[ck] = getCacheItem());
}
}
}