Revert "Virtualizing registration of the cache helper"

This reverts commit 04944f2c0c.
This commit is contained in:
Lars-Erik Aabech
2018-10-21 12:38:01 +02:00
parent 8894df919e
commit ae88932bb8
2 changed files with 20 additions and 33 deletions

View File

@@ -195,7 +195,15 @@ namespace Umbraco.Core.Runtime
container.ComposeConfiguration();
RegisterCacheHelper(container);
// register caches
// need the deep clone runtime cache profiver to ensure entities are cached properly, ie
// are cloned in and cloned out - no request-based cache here since no web-based context,
// will be overriden later or
container.RegisterSingleton(_ => new CacheHelper(
new DeepCloneRuntimeCacheProvider(new ObjectCacheRuntimeCacheProvider()),
new StaticCacheProvider(),
NullCacheProvider.Instance,
new IsolatedRuntimeCache(type => new DeepCloneRuntimeCacheProvider(new ObjectCacheRuntimeCacheProvider()))));
container.RegisterSingleton(f => f.GetInstance<CacheHelper>().RuntimeCache);
// register the plugin manager
@@ -228,22 +236,6 @@ namespace Umbraco.Core.Runtime
container.RegisterSingleton<MainDom>();
}
protected virtual void RegisterCacheHelper(IContainer container)
{
// register caches
// need the deep clone runtime cache profiver to ensure entities are cached properly, ie
// are cloned in and cloned out - no request-based cache here since no web-based context,
// will be overriden later or
container.RegisterSingleton(
"CacheHelper",
_ => new CacheHelper(
new DeepCloneRuntimeCacheProvider(new ObjectCacheRuntimeCacheProvider()),
new StaticCacheProvider(),
NullCacheProvider.Instance,
new IsolatedRuntimeCache(type =>
new DeepCloneRuntimeCacheProvider(new ObjectCacheRuntimeCacheProvider()))));
}
protected virtual void ComposeMapperCollection(MapperCollectionBuilder builder)
{
builder.AddCore();