diff --git a/build/NuSpecs/UmbracoCms.Web.nuspec b/build/NuSpecs/UmbracoCms.Web.nuspec
index 92cb0f065e..f12ada7e64 100644
--- a/build/NuSpecs/UmbracoCms.Web.nuspec
+++ b/build/NuSpecs/UmbracoCms.Web.nuspec
@@ -25,12 +25,12 @@
-->
-
+
-
+
-
+
diff --git a/src/Umbraco.Core/Cache/FastDictionaryAppCacheBase.cs b/src/Umbraco.Core/Cache/FastDictionaryAppCacheBase.cs
index 7ebbcc8b63..9eaf5fb833 100644
--- a/src/Umbraco.Core/Cache/FastDictionaryAppCacheBase.cs
+++ b/src/Umbraco.Core/Cache/FastDictionaryAppCacheBase.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
@@ -87,9 +87,10 @@ namespace Umbraco.Cms.Core.Cache
try
{
EnterWriteLock();
- foreach (var entry in GetDictionaryEntries()
- .ToArray())
+ foreach (var entry in GetDictionaryEntries().ToArray())
+ {
RemoveEntry((string) entry.Key);
+ }
}
finally
{
@@ -133,7 +134,9 @@ namespace Umbraco.Cms.Core.Cache
return value == null || (isInterface ? (type.IsInstanceOfType(value)) : (value.GetType() == type));
})
.ToArray())
+ {
RemoveEntry((string) entry.Key);
+ }
}
finally
{
@@ -163,7 +166,9 @@ namespace Umbraco.Cms.Core.Cache
return value == null || (isInterface ? (value is T) : (value.GetType() == typeOfT));
})
.ToArray())
+ {
RemoveEntry((string) entry.Key);
+ }
}
finally
{
@@ -196,7 +201,9 @@ namespace Umbraco.Cms.Core.Cache
// run predicate on the 'public key' part only, ie without prefix
&& predicate(((string) x.Key).Substring(plen), (T) value);
}))
+ {
RemoveEntry((string) entry.Key);
+ }
}
finally
{
@@ -214,7 +221,9 @@ namespace Umbraco.Cms.Core.Cache
foreach (var entry in GetDictionaryEntries()
.Where(x => ((string)x.Key).Substring(plen).InvariantStartsWith(keyStartsWith))
.ToArray())
+ {
RemoveEntry((string) entry.Key);
+ }
}
finally
{
@@ -233,7 +242,9 @@ namespace Umbraco.Cms.Core.Cache
foreach (var entry in GetDictionaryEntries()
.Where(x => compiled.IsMatch(((string)x.Key).Substring(plen)))
.ToArray())
+ {
RemoveEntry((string) entry.Key);
+ }
}
finally
{
@@ -261,10 +272,7 @@ namespace Umbraco.Cms.Core.Cache
protected abstract void EnterWriteLock();
protected abstract void ExitWriteLock();
- protected string GetCacheKey(string key)
- {
- return $"{CacheItemPrefix}-{key}";
- }
+ protected string GetCacheKey(string key) => $"{CacheItemPrefix}-{key}";
diff --git a/src/Umbraco.Core/Cache/GenericDictionaryRequestAppCache.cs b/src/Umbraco.Core/Cache/GenericDictionaryRequestAppCache.cs
deleted file mode 100644
index 17558a78d4..0000000000
--- a/src/Umbraco.Core/Cache/GenericDictionaryRequestAppCache.cs
+++ /dev/null
@@ -1,189 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-
-namespace Umbraco.Cms.Core.Cache
-{
- ///
- /// Implements a fast on top of HttpContext.Items.
- ///
- ///
- /// If no current HttpContext items can be found (no current HttpContext,
- /// or no Items...) then this cache acts as a pass-through and does not cache
- /// anything.
- ///
- public class GenericDictionaryRequestAppCache : FastDictionaryAppCacheBase, IRequestCache
- {
- ///
- /// Initializes a new instance of the class with a context, for unit tests!
- ///
- public GenericDictionaryRequestAppCache(Func> requestItems) : base()
- {
- ContextItems = requestItems;
- }
-
- private Func> ContextItems { get; }
-
- public bool IsAvailable => TryGetContextItems(out _);
-
- private bool TryGetContextItems(out IDictionary