Updates all cache refreshers to use ctor injection, no more applicationcontext singleton usages

This commit is contained in:
Shannon
2016-05-18 18:44:08 +02:00
parent 2880190b6f
commit 7fb1b4fb3b
26 changed files with 152 additions and 117 deletions

View File

@@ -9,6 +9,11 @@ namespace Umbraco.Web.Cache
/// </summary>
public sealed class ApplicationTreeCacheRefresher : CacheRefresherBase<ApplicationTreeCacheRefresher>
{
public ApplicationTreeCacheRefresher(CacheHelper cacheHelper) : base(cacheHelper)
{
}
protected override ApplicationTreeCacheRefresher Instance
{
get { return this; }
@@ -26,7 +31,7 @@ namespace Umbraco.Web.Cache
public override void RefreshAll()
{
ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheItem(CacheKeys.ApplicationTreeCacheKey);
CacheHelper.RuntimeCache.ClearCacheItem(CacheKeys.ApplicationTreeCacheKey);
base.RefreshAll();
}
@@ -38,7 +43,7 @@ namespace Umbraco.Web.Cache
public override void Remove(int id)
{
ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheItem(CacheKeys.ApplicationTreeCacheKey);
CacheHelper.RuntimeCache.ClearCacheItem(CacheKeys.ApplicationTreeCacheKey);
base.Remove(id);
}