pschelpdesk/Vendor/Prise.Mvc/DefaultStaticPluginCacheAccessorBootstrapper.cs
2024-11-04 20:45:34 +01:00

24 lines
665 B
C#

using System;
using Prise.Caching;
namespace Prise.Mvc
{
public class DefaultStaticPluginCacheAccessorBootstrapper : IPluginCacheAccessorBootstrapper
{
protected bool isBootstrapped;
public DefaultStaticPluginCacheAccessorBootstrapper(IPluginCache cache)
{
if (this.isBootstrapped)
throw new NotSupportedException($"IPluginCache was already bootstrapped");
this.SetCurrentCache(cache);
this.isBootstrapped = true;
}
public void SetCurrentCache(IPluginCache cache)
{
DefaultStaticPluginCacheAccessor.CurrentCache = cache;
}
}
}