diff --git a/Src/Dnn/ToSic.Sxc.Dnn.Core/Dnn/Code/DnnDynamicCodeRootTT.cs b/Src/Dnn/ToSic.Sxc.Dnn.Core/Dnn/Code/DnnDynamicCodeRootTT.cs index c83e003355..dc9bc9b311 100644 --- a/Src/Dnn/ToSic.Sxc.Dnn.Core/Dnn/Code/DnnDynamicCodeRootTT.cs +++ b/Src/Dnn/ToSic.Sxc.Dnn.Core/Dnn/Code/DnnDynamicCodeRootTT.cs @@ -17,6 +17,6 @@ public DnnDynamicCodeRoot(Dependencies dependencies): base(dependencies, DnnCons /// Dnn context with module, page, portal etc. /// public IDnnContext Dnn => _dnn.Get(GetService); - private readonly ValueGetOnce _dnn = new ValueGetOnce(); + private readonly GetOnce _dnn = new GetOnce(); } } \ No newline at end of file diff --git a/Src/Dnn/ToSic.Sxc.Dnn.Razor/Custom/Hybrid/Advanced/Razor14_TT.cs b/Src/Dnn/ToSic.Sxc.Dnn.Razor/Custom/Hybrid/Advanced/Razor14_TT.cs index 29782710bc..e198d9ebc2 100644 --- a/Src/Dnn/ToSic.Sxc.Dnn.Razor/Custom/Hybrid/Advanced/Razor14_TT.cs +++ b/Src/Dnn/ToSic.Sxc.Dnn.Razor/Custom/Hybrid/Advanced/Razor14_TT.cs @@ -36,6 +36,6 @@ protected Razor14() public TModel Model => !(_DynCodeRoot is IDynamicCode root) ? default : root.Model; public TServiceKit Kit => _kit.Get(() => _DynCodeRoot.GetKit()); - private readonly ValueGetOnce _kit = new ValueGetOnce(); + private readonly GetOnce _kit = new GetOnce(); } } diff --git a/Src/Dnn/ToSic.Sxc.Dnn.Razor/Engines/Razor/HtmlHelper.cs b/Src/Dnn/ToSic.Sxc.Dnn.Razor/Engines/Razor/HtmlHelper.cs index e712ac252e..338fae222d 100644 --- a/Src/Dnn/ToSic.Sxc.Dnn.Razor/Engines/Razor/HtmlHelper.cs +++ b/Src/Dnn/ToSic.Sxc.Dnn.Razor/Engines/Razor/HtmlHelper.cs @@ -105,6 +105,6 @@ public IHtmlString Partial(string path, params object[] data) private bool ThrowPartialError => _throwPartialError.Get(() => _features.IsEnabled(RazorThrowPartial.NameId) || _isSystemAdmin && _features.IsEnabled(RenderThrowPartialSystemAdmin.NameId)); - private readonly ValueGetOnce _throwPartialError = new ValueGetOnce(); + private readonly GetOnce _throwPartialError = new GetOnce(); } } \ No newline at end of file diff --git a/Src/Dnn/ToSic.Sxc.Dnn.WebApi/Custom/Hybrid/Advanced/Api14_TT.cs b/Src/Dnn/ToSic.Sxc.Dnn.WebApi/Custom/Hybrid/Advanced/Api14_TT.cs index f38639d97f..051edb40ff 100644 --- a/Src/Dnn/ToSic.Sxc.Dnn.WebApi/Custom/Hybrid/Advanced/Api14_TT.cs +++ b/Src/Dnn/ToSic.Sxc.Dnn.WebApi/Custom/Hybrid/Advanced/Api14_TT.cs @@ -31,7 +31,7 @@ protected Api14(string logSuffix) : base(logSuffix) { } public TModel Model => !(_DynCodeRoot is IDynamicCode root) ? default : root.Model; public TServiceKit Kit => _kit.Get(() => _DynCodeRoot.GetKit()); - private readonly ValueGetOnce _kit = new ValueGetOnce(); + private readonly GetOnce _kit = new GetOnce(); } } diff --git a/Src/Dnn/ToSic.Sxc.Dnn.WebApi/WebApi/SxcApiControllerBase.cs b/Src/Dnn/ToSic.Sxc.Dnn.WebApi/WebApi/SxcApiControllerBase.cs index 598226c16f..67c238f566 100644 --- a/Src/Dnn/ToSic.Sxc.Dnn.WebApi/WebApi/SxcApiControllerBase.cs +++ b/Src/Dnn/ToSic.Sxc.Dnn.WebApi/WebApi/SxcApiControllerBase.cs @@ -30,7 +30,7 @@ protected override void Initialize(HttpControllerContext controllerContext) protected IContextResolver SharedContextResolver; [PrivateApi] protected IBlock GetBlock() => _blockOfRequest.Get(() => GetService().GetCmsBlock(Request, Log)); - private readonly ValueGetOnce _blockOfRequest = new ValueGetOnce(); + private readonly GetOnce _blockOfRequest = new GetOnce(); } } diff --git a/Src/Dnn/ToSic.Sxc.Dnn/View.ascx.cs b/Src/Dnn/ToSic.Sxc.Dnn/View.ascx.cs index ee6da561cb..0d1827321b 100644 --- a/Src/Dnn/ToSic.Sxc.Dnn/View.ascx.cs +++ b/Src/Dnn/ToSic.Sxc.Dnn/View.ascx.cs @@ -29,12 +29,12 @@ public partial class View : PortalModuleBase, IActionable /// which runs before page-load /// private IBlock Block => _blockGetOnce.Get(() => LogTimer.DoInTimer(() => GetService().Init(Log).GetBlock(ModuleConfiguration, null))); - private readonly ValueGetOnce _blockGetOnce = new ValueGetOnce(); + private readonly GetOnce _blockGetOnce = new GetOnce(); private ILog Log { get; } = new Log("Sxc.View"); protected LogCall LogTimer => _logTimer.Get(() => Log.Fn(message: $"Page:{TabId} '{Page?.Title}', Module:{ModuleId} '{ModuleConfiguration.ModuleTitle}'")); - private readonly ValueGetOnce _logTimer = new ValueGetOnce(); + private readonly GetOnce _logTimer = new GetOnce(); /// /// Page Load event @@ -163,6 +163,6 @@ private IRenderResult RenderViewAndGatherJsCssSpecs() protected IOutputCache OutputCache => _oc.Get(() => GetService().Init(Log).Init(ModuleId, TabId, Block)); - private readonly ValueGetOnce _oc = new ValueGetOnce(); + private readonly GetOnce _oc = new GetOnce(); } } \ No newline at end of file diff --git a/Src/Oqtane/ToSic.Sxc.Oqt.Server/Blocks/OqtSxcViewBuilder.cs b/Src/Oqtane/ToSic.Sxc.Oqt.Server/Blocks/OqtSxcViewBuilder.cs index 5150fc01e4..b5988a883a 100644 --- a/Src/Oqtane/ToSic.Sxc.Oqt.Server/Blocks/OqtSxcViewBuilder.cs +++ b/Src/Oqtane/ToSic.Sxc.Oqt.Server/Blocks/OqtSxcViewBuilder.cs @@ -119,14 +119,14 @@ public OqtViewResultsDto Prepare(Alias alias, Site site, Page page, Module modul _contextResolverForLookUps.AttachRealBlock(() => block); return block; })); - private readonly ValueGetOnce _blockGetOnce = new(); + private readonly GetOnce _blockGetOnce = new(); protected LogCall LogTimer => _logTimer.Get(() => Log.Fn(message: $"Page:{Page?.PageId} '{Page?.Name}', Module:{Module?.ModuleId} '{Module?.Title}'")); - private readonly ValueGetOnce _logTimer = new(); + private readonly GetOnce _logTimer = new(); protected IOutputCache OutputCache => _oc.Get(() => _outputCache.Init(Log).Init(Module.ModuleId, Page?.PageId ?? 0, Block)); - private readonly ValueGetOnce _oc = new(); + private readonly GetOnce _oc = new(); #endregion } diff --git a/Src/Oqtane/ToSic.Sxc.Oqt.Server/Custom/Hybrid/Advanced/Hybrid.Api14_TT.cs b/Src/Oqtane/ToSic.Sxc.Oqt.Server/Custom/Hybrid/Advanced/Hybrid.Api14_TT.cs index b3fcef0cf3..38c679b64a 100644 --- a/Src/Oqtane/ToSic.Sxc.Oqt.Server/Custom/Hybrid/Advanced/Hybrid.Api14_TT.cs +++ b/Src/Oqtane/ToSic.Sxc.Oqt.Server/Custom/Hybrid/Advanced/Hybrid.Api14_TT.cs @@ -19,7 +19,7 @@ public abstract class Api14 : Api12, IDynamicCode _DynCodeRoot is not IDynamicCode root ? default : root.Model; public TServiceKit Kit => _kit.Get(() => _DynCodeRoot.GetKit()); - private readonly ValueGetOnce _kit = new(); + private readonly GetOnce _kit = new(); } } \ No newline at end of file diff --git a/Src/Razor/ToSic.Sxc.Razor/Custom.Hybrid/Advanced/Razor14_TT.cs b/Src/Razor/ToSic.Sxc.Razor/Custom.Hybrid/Advanced/Razor14_TT.cs index ed9079c3d4..4d547fe172 100644 --- a/Src/Razor/ToSic.Sxc.Razor/Custom.Hybrid/Advanced/Razor14_TT.cs +++ b/Src/Razor/ToSic.Sxc.Razor/Custom.Hybrid/Advanced/Razor14_TT.cs @@ -12,6 +12,6 @@ public abstract class Razor14: Razor12, IRazor14 _kit.Get(() => _DynCodeRoot.GetKit()); - private readonly ValueGetOnce _kit = new(); + private readonly GetOnce _kit = new(); } } diff --git a/Src/Sxc/ToSic.Sxc/Blocks/BlockBuilder_Render.cs b/Src/Sxc/ToSic.Sxc/Blocks/BlockBuilder_Render.cs index 84f2fa5056..072faf3bdb 100644 --- a/Src/Sxc/ToSic.Sxc/Blocks/BlockBuilder_Render.cs +++ b/Src/Sxc/ToSic.Sxc/Blocks/BlockBuilder_Render.cs @@ -17,7 +17,7 @@ public partial class BlockBuilder [PrivateApi] public IRenderingHelper RenderingHelper => _rendHelp.Get(() => _deps.RenderHelpGen.New.Init(Block, Log)); - private readonly ValueGetOnce _rendHelp = new ValueGetOnce(); + private readonly GetOnce _rendHelp = new GetOnce(); public IRenderResult Run(bool topLevel) { @@ -200,7 +200,7 @@ public IRenderResult Run(bool topLevel) /// license ok state /// protected bool LicenseOk => _licenseOk.Get(() => _deps.LicenseService.Value.HaveValidLicense); - private readonly ValueGetOnce _licenseOk = new ValueGetOnce(); + private readonly GetOnce _licenseOk = new GetOnce(); private string GenerateWarningMsgIfLicenseNotOk() { diff --git a/Src/Sxc/ToSic.Sxc/Blocks/RenderResult.cs b/Src/Sxc/ToSic.Sxc/Blocks/RenderResult.cs index d626a31598..a44a834b68 100644 --- a/Src/Sxc/ToSic.Sxc/Blocks/RenderResult.cs +++ b/Src/Sxc/ToSic.Sxc/Blocks/RenderResult.cs @@ -16,7 +16,7 @@ public class RenderResult : HybridHtmlString, IRenderResult public string Html { get; set; } public int Size => _size.Get(() => Html?.Length ?? 0); - private readonly ValueGetOnce _size = new ValueGetOnce(); + private readonly GetOnce _size = new GetOnce(); /// public bool CanCache { get; set; } diff --git a/Src/Sxc/ToSic.Sxc/Code/DynamicCodeRootTT.cs b/Src/Sxc/ToSic.Sxc/Code/DynamicCodeRootTT.cs index 99414feffd..9a3689e5aa 100644 --- a/Src/Sxc/ToSic.Sxc/Code/DynamicCodeRootTT.cs +++ b/Src/Sxc/ToSic.Sxc/Code/DynamicCodeRootTT.cs @@ -15,6 +15,6 @@ protected DynamicCodeRoot(Dependencies dependencies, string logPrefix) : base(de //private readonly ValueGetOnce _mOnce = new ValueGetOnce(); public TServiceKit Kit => _kit.Get(GetService); - private readonly ValueGetOnce _kit = new ValueGetOnce(); + private readonly GetOnce _kit = new GetOnce(); } } diff --git a/Src/Sxc/ToSic.Sxc/Code/DynamicCodeRoot_As.cs b/Src/Sxc/ToSic.Sxc/Code/DynamicCodeRoot_As.cs index e6d34838fe..13aafbe0ef 100644 --- a/Src/Sxc/ToSic.Sxc/Code/DynamicCodeRoot_As.cs +++ b/Src/Sxc/ToSic.Sxc/Code/DynamicCodeRoot_As.cs @@ -138,7 +138,7 @@ public IEnumerable AsList(object list) internal AdamManager AdamManager => _admMng.Get(() => GetService() .Init(ContextForAdamManager(), CompatibilityLevel, Log)); - private readonly ValueGetOnce _admMng = new ValueGetOnce(); + private readonly GetOnce _admMng = new GetOnce(); /// /// Special helper - if the DynamicCode is generated by the service or used in a WebApi there is no block, but we can figure out the context. diff --git a/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsContext.cs b/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsContext.cs index 64c1f237c8..c799805e46 100644 --- a/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsContext.cs +++ b/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsContext.cs @@ -42,7 +42,7 @@ Lazy cmsSiteLazy private readonly Lazy _pageLazy; internal IContextOfSite CtxSite => _ctxSite.Get(() => CtxBlockOrNull ?? _initialContext); - private readonly ValueGetOnce _ctxSite = new ValueGetOnce(); + private readonly GetOnce _ctxSite = new GetOnce(); private readonly IAppStates _appStates; private readonly Lazy _cmsSiteLazy; @@ -57,21 +57,21 @@ Lazy cmsSiteLazy internal DynamicEntityDependencies DEDeps => (CodeRoot as DynamicCodeRoot)?.DynamicEntityDependencies; private AppState SiteAppState => _siteAppState.Get(() => _appStates.GetPrimaryApp(CtxSite.Site.ZoneId, Log)); - private readonly ValueGetOnce _siteAppState = new ValueGetOnce(); + private readonly GetOnce _siteAppState = new GetOnce(); private IBlock RealBlockOrNull => _realBlock.Get(() => CodeRoot?.Block); - private readonly ValueGetOnce _realBlock = new ValueGetOnce(); + private readonly GetOnce _realBlock = new GetOnce(); internal IContextOfBlock CtxBlockOrNull => _ctxBlock.Get(() => CodeRoot?.Block?.Context); - private readonly ValueGetOnce _ctxBlock = new ValueGetOnce(); + private readonly GetOnce _ctxBlock = new GetOnce(); #endregion public ICmsPlatform Platform { get; } public ICmsSite Site => _site.Get(() => _cmsSiteLazy.Value.Init(this, SiteAppState)); - private readonly ValueGetOnce _site = new ValueGetOnce(); + private readonly GetOnce _site = new GetOnce(); public ICmsPage Page => _page ?? (_page = new CmsPage(this, SiteAppState, _pageLazy)); private ICmsPage _page; diff --git a/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsContextPartBase.cs b/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsContextPartBase.cs index 798d430f39..9beaecf73a 100644 --- a/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsContextPartBase.cs +++ b/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsContextPartBase.cs @@ -22,10 +22,10 @@ protected void Init(CmsContext parent, T contents) } public IDynamicMetadata Metadata => _dynMeta.Get(() => new DynamicMetadata((this as IHasMetadata).Metadata, null, _parent.DEDeps)); - private readonly ValueGetOnce _dynMeta = new ValueGetOnce(); + private readonly GetOnce _dynMeta = new GetOnce(); IMetadataOf IHasMetadata.Metadata => _md.Get(GetMetadataOf); - private readonly ValueGetOnce _md = new ValueGetOnce(); + private readonly GetOnce _md = new GetOnce(); protected abstract IMetadataOf GetMetadataOf(); diff --git a/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsSite.cs b/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsSite.cs index 43d5241275..30752b5275 100644 --- a/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsSite.cs +++ b/Src/Sxc/ToSic.Sxc/Context/CmsContext/CmsSite.cs @@ -31,7 +31,7 @@ public ICmsSite Init(CmsContext parent, AppState appState) public string UrlRoot => _contents.UrlRoot ?? string.Empty; public IApp App => _app.Get(() => _siteAppLazy.Value.Init(_appState, null, null)); - private readonly ValueGetOnce _app = new ValueGetOnce(); + private readonly GetOnce _app = new GetOnce(); protected override IMetadataOf GetMetadataOf() => ExtendWithRecommendations(_appState.GetMetadataOf(TargetTypes.Site, Id, Url)); diff --git a/Src/Sxc/ToSic.Sxc/Custom.Hybrid/Advanced/Code14_TT.cs b/Src/Sxc/ToSic.Sxc/Custom.Hybrid/Advanced/Code14_TT.cs index ed31512811..65ffad4e21 100644 --- a/Src/Sxc/ToSic.Sxc/Custom.Hybrid/Advanced/Code14_TT.cs +++ b/Src/Sxc/ToSic.Sxc/Custom.Hybrid/Advanced/Code14_TT.cs @@ -28,7 +28,7 @@ public abstract class Code14: DynamicCode, IDynamicCode14 !(_DynCodeRoot is IDynamicCode root) ? default : root.Model; public TServiceKit Kit => _kit.Get(() => _DynCodeRoot.GetKit()); - private readonly ValueGetOnce _kit = new ValueGetOnce(); + private readonly GetOnce _kit = new GetOnce(); /// public dynamic Resources => _DynCodeRoot?.Resources; diff --git a/Src/Sxc/ToSic.Sxc/Data/DynamicEntityBase/DynamicEntityBase.cs b/Src/Sxc/ToSic.Sxc/Data/DynamicEntityBase/DynamicEntityBase.cs index 992b329a41..1c6d2b0a9f 100644 --- a/Src/Sxc/ToSic.Sxc/Data/DynamicEntityBase/DynamicEntityBase.cs +++ b/Src/Sxc/ToSic.Sxc/Data/DynamicEntityBase/DynamicEntityBase.cs @@ -55,7 +55,7 @@ internal static IDynamicEntity SubDynEntityOrNull(IEntity contents, DynamicEntit #endregion protected ILog LogOrNull => _logOrNull.Get(() => _Dependencies.LogOrNull?.SubLogOrNull("DynEnt", Debug)); - private readonly ValueGetOnce _logOrNull = new ValueGetOnce(); + private readonly GetOnce _logOrNull = new GetOnce(); } } diff --git a/Src/Sxc/ToSic.Sxc/Data/Field/DynamicField.cs b/Src/Sxc/ToSic.Sxc/Data/Field/DynamicField.cs index 72bfc4a411..28d26366d8 100644 --- a/Src/Sxc/ToSic.Sxc/Data/Field/DynamicField.cs +++ b/Src/Sxc/ToSic.Sxc/Data/Field/DynamicField.cs @@ -21,19 +21,19 @@ internal DynamicField(IDynamicEntity parent, string name) /// public dynamic Raw => _raw.Get(() => Parent.Get(Name, convertLinks: false)); - private readonly ValueGetOnce _raw = new ValueGetOnce(); + private readonly GetOnce _raw = new GetOnce(); /// public dynamic Value => _value.Get(() => Parent.Get(Name, convertLinks: true)); - private readonly ValueGetOnce _value = new ValueGetOnce(); + private readonly GetOnce _value = new GetOnce(); /// public string Url => Value as string; public IDynamicMetadata Metadata => _dynMeta.Get(() => new DynamicMetadata(MetadataOfItem, Parent.Entity, Parent._Dependencies)); - private readonly ValueGetOnce _dynMeta = new ValueGetOnce(); + private readonly GetOnce _dynMeta = new GetOnce(); /// @@ -43,7 +43,7 @@ internal DynamicField(IDynamicEntity parent, string name) var app = Parent._Dependencies?.BlockOrNull?.Context?.AppState; return app?.GetMetadataOf(TargetTypes.CmsItem, valString, ""); }); - private readonly ValueGetOnce _itemMd = new ValueGetOnce(); + private readonly GetOnce _itemMd = new GetOnce(); @@ -52,7 +52,7 @@ internal DynamicField(IDynamicEntity parent, string name) var decItem = MetadataOfItem?.FirstOrDefaultOfType(ImageDecorator.TypeName); return decItem != null ? new ImageDecorator(decItem) : null; }); - private readonly ValueGetOnce _imgDec2 = new ValueGetOnce(); + private readonly GetOnce _imgDec2 = new GetOnce(); IMetadataOf IHasMetadata.Metadata => MetadataOfItem; } diff --git a/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Builder/ToolbarBuilder_Helpers.cs b/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Builder/ToolbarBuilder_Helpers.cs index 9ca1042e19..23f3184f9c 100644 --- a/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Builder/ToolbarBuilder_Helpers.cs +++ b/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Builder/ToolbarBuilder_Helpers.cs @@ -16,6 +16,6 @@ public partial class ToolbarBuilder private ObjectToUrl O2U => _o2u.Get(() => new ObjectToUrl()); - private readonly ValueGetOnce _o2u = new ValueGetOnce(); + private readonly GetOnce _o2u = new GetOnce(); } } diff --git a/Src/Sxc/ToSic.Sxc/Edit/Toolbar/ItemToolbar/ItemToolbarV10.cs b/Src/Sxc/ToSic.Sxc/Edit/Toolbar/ItemToolbar/ItemToolbarV10.cs index 00f8ceaf50..86735335fd 100644 --- a/Src/Sxc/ToSic.Sxc/Edit/Toolbar/ItemToolbar/ItemToolbarV10.cs +++ b/Src/Sxc/ToSic.Sxc/Edit/Toolbar/ItemToolbar/ItemToolbarV10.cs @@ -25,7 +25,7 @@ public override string ToolbarAsTag => ToolbarTagTemplate.Replace(ToolbarTagPlaceholder, ToolbarAttributes(JsonToolbarNodeName)); protected override string ToolbarJson => _toolbarJson.Get(ToolbarV10Json); - private readonly ValueGetOnce _toolbarJson = new ValueGetOnce(); + private readonly GetOnce _toolbarJson = new GetOnce(); public override string ToolbarAsAttributes() => ToolbarAttributes(ToolbarAttributeName); diff --git a/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Rules/ToolbarRuleForEntity.cs b/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Rules/ToolbarRuleForEntity.cs index 6a72717088..ccbacc7cf5 100644 --- a/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Rules/ToolbarRuleForEntity.cs +++ b/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Rules/ToolbarRuleForEntity.cs @@ -49,10 +49,10 @@ private void SetPropsToSerialize(bool defaultSerialize, string[] opposite) protected IEntity TargetEntity => _entity.Get(() => Target as IEntity ?? (Target as IEntityWrapper)?.Entity); - private readonly ValueGetOnce _entity = new ValueGetOnce(); + private readonly GetOnce _entity = new GetOnce(); internal EntityEditInfo EditInfo => _editInfo.Get(() => new EntityEditInfo(TargetEntity)); - private readonly ValueGetOnce _editInfo = new ValueGetOnce(); + private readonly GetOnce _editInfo = new GetOnce(); protected override string DecoratorTypeName => TargetEntity?.Type?.Name; diff --git a/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Rules/ToolbarRuleTargeted.cs b/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Rules/ToolbarRuleTargeted.cs index dfa02441da..dcc7102af6 100644 --- a/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Rules/ToolbarRuleTargeted.cs +++ b/Src/Sxc/ToSic.Sxc/Edit/Toolbar/Rules/ToolbarRuleTargeted.cs @@ -52,7 +52,7 @@ public override string GeneratedUiParams() var decoTypeName = DecoratorTypeName; return decoTypeName.HasValue() ? DecoHelper?.GetDecorator(Context, decoTypeName ?? "", Command) : null; }); - private readonly ValueGetOnce _decorator = new ValueGetOnce(); + private readonly GetOnce _decorator = new GetOnce(); private string UiParams() => Decorator?.AllRules(); #endregion diff --git a/Src/Sxc/ToSic.Sxc/Images/ImageService/ImageService.cs b/Src/Sxc/ToSic.Sxc/Images/ImageService/ImageService.cs index 6fa6b809c8..5b9996391d 100644 --- a/Src/Sxc/ToSic.Sxc/Images/ImageService/ImageService.cs +++ b/Src/Sxc/ToSic.Sxc/Images/ImageService/ImageService.cs @@ -29,7 +29,7 @@ public void ConnectToRoot(IDynamicCodeRoot codeRoot) internal IEditService EditOrNull => _codeRootOrNull?.Edit; internal IToolbarService ToolbarOrNull => _toolbarSvc.Get(() => _codeRootOrNull?.GetService()); - private readonly ValueGetOnce _toolbarSvc = new ValueGetOnce(); + private readonly GetOnce _toolbarSvc = new GetOnce(); #endregion diff --git a/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsiveBase.cs b/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsiveBase.cs index a012f02748..afd924ba1b 100644 --- a/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsiveBase.cs +++ b/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsiveBase.cs @@ -29,7 +29,7 @@ protected ResponsiveBase(ImageService imgService, ResponsiveParams callParams, s Log.A(ImgService.Debug, $"{nameof(ThisResize)}: " + t?.Dump()); return t; }); - private readonly ValueGetOnce _thisResize = new ValueGetOnce(); + private readonly GetOnce _thisResize = new GetOnce(); internal IResizeSettings Settings => Call.Settings; @@ -75,7 +75,7 @@ public virtual Img Img private Img _imgTag; public ITag Tag => _tag.Get(GetTagWithToolbar); - private readonly ValueGetOnce _tag = new ValueGetOnce(); + private readonly GetOnce _tag = new GetOnce(); protected virtual ITag GetOutermostTag() => Img; @@ -106,12 +106,12 @@ private ITag GetTagWithToolbar() /// public string Alt => _alt.Get(() => Call.ImgAlt ?? Call.Field?.ImageDecoratorOrNull?.Description); - private readonly ValueGetOnce _alt = new ValueGetOnce(); + private readonly GetOnce _alt = new GetOnce(); /// public string Class => _imgClass.Get(ClassGenerator); - private readonly ValueGetOnce _imgClass = new ValueGetOnce(); + private readonly GetOnce _imgClass = new GetOnce(); private string ClassGenerator() { var wrapLog = Log.Fn(ImgService.Debug); @@ -135,7 +135,7 @@ private string ClassGenerator() /// public string SrcSet => _srcSet.Get(SrcSetGenerator); - private readonly ValueGetOnce _srcSet = new ValueGetOnce(); + private readonly GetOnce _srcSet = new GetOnce(); private string SrcSetGenerator() { var isEnabled = ImgService.Features.IsEnabled(ImageServiceMultipleSizes.NameId); @@ -151,7 +151,7 @@ private string SrcSetGenerator() /// public string Width => _width.Get(WidthGenerator); - private readonly ValueGetOnce _width = new ValueGetOnce(); + private readonly GetOnce _width = new GetOnce(); private string WidthGenerator() { var setWidth = ThisResize.Recipe?.SetWidth; @@ -166,7 +166,7 @@ private string WidthGenerator() /// public string Height => _height.Get(HeightGenerator); - private readonly ValueGetOnce _height = new ValueGetOnce(); + private readonly GetOnce _height = new GetOnce(); private string HeightGenerator() { var setHeight = ThisResize.Recipe?.SetHeight; @@ -179,7 +179,7 @@ private string HeightGenerator() public string Sizes => _sizes.Get(SizesGenerator); - private readonly ValueGetOnce _sizes = new ValueGetOnce(); + private readonly GetOnce _sizes = new GetOnce(); private string SizesGenerator() { var wrapLog = Log.Fn(ImgService.Debug); diff --git a/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsiveImage.cs b/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsiveImage.cs index a18fa55c99..7adfa0f272 100644 --- a/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsiveImage.cs +++ b/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsiveImage.cs @@ -21,7 +21,7 @@ internal ResponsiveImage(ImageService imgService, ResponsiveParams callParams) : if (!string.IsNullOrEmpty(Sizes)) img.Sizes(Sizes); return img; }); - private readonly ValueGetOnce _img2 = new ValueGetOnce(); + private readonly GetOnce _img2 = new GetOnce(); } } diff --git a/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsivePicture.cs b/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsivePicture.cs index add062e4d8..af05b82638 100644 --- a/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsivePicture.cs +++ b/Src/Sxc/ToSic.Sxc/Images/Responsive/ResponsivePicture.cs @@ -18,12 +18,12 @@ internal ResponsivePicture(ImageService imgService, ResponsiveParams callParams) public Picture Picture => _picTag.Get(() => Razor.Blade.Tag.Picture(Sources, Img)); - private readonly ValueGetOnce _picTag = new ValueGetOnce(); + private readonly GetOnce _picTag = new GetOnce(); protected override ITag GetOutermostTag() => Picture; public TagList Sources => _sourceTags.Get(() => SourceTagsInternal(Call.Link.Url, Settings)); - private readonly ValueGetOnce _sourceTags = new ValueGetOnce(); + private readonly GetOnce _sourceTags = new GetOnce(); private TagList SourceTagsInternal(string url, IResizeSettings resizeSettings) { diff --git a/Src/Sxc/ToSic.Sxc/Services/ServiceKits/ServiceKit14.cs b/Src/Sxc/ToSic.Sxc/Services/ServiceKits/ServiceKit14.cs index 43e5f79f44..60b9dd68d4 100644 --- a/Src/Sxc/ToSic.Sxc/Services/ServiceKits/ServiceKit14.cs +++ b/Src/Sxc/ToSic.Sxc/Services/ServiceKits/ServiceKit14.cs @@ -20,20 +20,20 @@ public class ServiceKit14: ServiceKit /// The ADAM Service, used to retrieve files and maybe more. /// public IAdamService Adam => _adam.Get(GetService); - private readonly ValueGetOnce _adam = new ValueGetOnce(); + private readonly GetOnce _adam = new GetOnce(); /// /// The Convert Service, used to convert any kind of data type to another data type /// public IConvertService Convert => _convert.Get(GetService); - private readonly ValueGetOnce _convert = new ValueGetOnce(); + private readonly GetOnce _convert = new GetOnce(); /// /// The Koi CSS Service, used to detect the current CSS framework and other features. /// See [ICss](xref:Connect.Koi.ICss) /// public ICss Css => _css.Get(GetService); - private readonly ValueGetOnce _css = new ValueGetOnce(); + private readonly GetOnce _css = new GetOnce(); // Wait till we have a signature without the IEntity, but more an IHasEntity or something @@ -48,82 +48,82 @@ public class ServiceKit14: ServiceKit /// The Edit service, same as the main Edit service /// public IEditService Edit => _edit.Get(GetService); - private readonly ValueGetOnce _edit = new ValueGetOnce(); + private readonly GetOnce _edit = new GetOnce(); /// /// The Features services, used to check if features are enabled /// public IFeaturesService Feature => _features.Get(GetService); - private readonly ValueGetOnce _features = new ValueGetOnce(); + private readonly GetOnce _features = new GetOnce(); /// /// The Images service, used to create `img` and `picture` tags /// public IImageService Image => _image.Get(GetService); - private readonly ValueGetOnce _image = new ValueGetOnce(); + private readonly GetOnce _image = new GetOnce(); /// /// The JSON service, used to convert data to-and-from JSON /// public IJsonService Json => _json.Get(GetService); - private readonly ValueGetOnce _json = new ValueGetOnce(); + private readonly GetOnce _json = new GetOnce(); /// /// The JSON service, used to convert data to-and-from JSON /// public ILinkService Link => _link.Get(GetService); - private readonly ValueGetOnce _link = new ValueGetOnce(); + private readonly GetOnce _link = new GetOnce(); /// /// The System Log service, used to add log messages to the system (Dnn/Oqtane) /// public ILogService Log => _sysLog.Get(GetService); - private readonly ValueGetOnce _sysLog = new ValueGetOnce(); + private readonly GetOnce _sysLog = new GetOnce(); /// /// The Mail service, used to send mails /// public IMailService Mail => _mail.Get(GetService); - private readonly ValueGetOnce _mail = new ValueGetOnce(); + private readonly GetOnce _mail = new GetOnce(); /// /// The Page service, used to set headers, activate features etc. /// public IPageService Page => _page.Get(GetService); - private readonly ValueGetOnce _page = new ValueGetOnce(); + private readonly GetOnce _page = new GetOnce(); /// /// The Render service, used to render one or more dynamic content within other content /// public IRenderService Render => _render.Get(GetService); - private readonly ValueGetOnce _render = new ValueGetOnce(); + private readonly GetOnce _render = new GetOnce(); /// /// The Secure Data Service - mainly for reading / decrypting secrets. /// public ISecureDataService SecureData => _secureData.Get(GetService); - private readonly ValueGetOnce _secureData = new ValueGetOnce(); + private readonly GetOnce _secureData = new GetOnce(); /// /// The Razor-Blade Scrub service, used to clean up HTML. /// See [IScrub](xref:ToSic.Razor.Blade.IScrub) /// public IScrub Scrub => _scrub.Get(GetService); - private readonly ValueGetOnce _scrub = new ValueGetOnce(); + private readonly GetOnce _scrub = new GetOnce(); /// /// The toolbar service, used to generate advanced toolbars /// public IToolbarService Toolbar => _toolbar.Get(GetService); - private readonly ValueGetOnce _toolbar = new ValueGetOnce(); + private readonly GetOnce _toolbar = new GetOnce(); } } diff --git a/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspOfApp.cs b/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspOfApp.cs index 97a54d7db4..0166458a41 100644 --- a/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspOfApp.cs +++ b/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspOfApp.cs @@ -50,7 +50,7 @@ public void ConnectToRoot(IDynamicCodeRoot codeRoot) #region Read Settings public string AppPolicies => _appPolicies.Get(GetAppPolicies); - private readonly ValueGetOnce _appPolicies = new ValueGetOnce(); + private readonly GetOnce _appPolicies = new GetOnce(); private string GetAppPolicies() { diff --git a/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspOfModule.cs b/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspOfModule.cs index 8c33185ac1..7d45835e84 100644 --- a/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspOfModule.cs +++ b/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspOfModule.cs @@ -78,7 +78,7 @@ internal bool RegisterAppCsp(CspOfApp appCsp) #region Url Parameters to Detect Dev / True public bool UrlIsDevMode => _urlDevMode.Get(() => CspUrlParam.EqualsInsensitive(CspConstants.CspUrlDev)); - private readonly ValueGetOnce _urlDevMode = new ValueGetOnce(); + private readonly GetOnce _urlDevMode = new GetOnce(); private string CspUrlParam => _cspUrlParam.Get(() => { @@ -89,7 +89,7 @@ internal bool RegisterAppCsp(CspOfApp appCsp) pageParameters.TryGetValue(CspConstants.CspUrlParameter, out var cspParam); return cspParam; }, Log, nameof(CspUrlParam)); - private readonly ValueGetOnce _cspUrlParam = new ValueGetOnce(); + private readonly GetOnce _cspUrlParam = new GetOnce(); #endregion @@ -103,7 +103,7 @@ internal bool RegisterAppCsp(CspOfApp appCsp) var pageSettings = CodeRootSettings()?.GetStack(PartSiteSystem, PartGlobalSystem, PartPresetSystem); return new CspSettingsReader(pageSettings, _user, UrlIsDevMode, Log); }, Log, nameof(SiteCspSettings)); - private readonly ValueGetOnce _siteCspSettings = new ValueGetOnce(); + private readonly GetOnce _siteCspSettings = new GetOnce(); #endregion @@ -113,7 +113,7 @@ internal bool RegisterAppCsp(CspOfApp appCsp) /// Enforce? /// internal bool IsEnforced => _cspReportOnly.Get(() => SiteCspSettings.IsEnforced, Log, nameof(IsEnforced)); - private readonly ValueGetOnce _cspReportOnly = new ValueGetOnce(); + private readonly GetOnce _cspReportOnly = new GetOnce(); /// @@ -134,7 +134,7 @@ internal bool RegisterAppCsp(CspOfApp appCsp) // Check URL Parameters - they are null if the feature is not enabled return CspUrlParam.EqualsInsensitive(CspConstants.CspUrlTrue) || UrlIsDevMode; }, Log, nameof(IsEnabled)); - private readonly ValueGetOnce _enabled = new ValueGetOnce(); + private readonly GetOnce _enabled = new GetOnce(); #endregion @@ -150,7 +150,7 @@ internal bool RegisterAppCsp(CspOfApp appCsp) Log.A($"Merged: {merged}"); return new CspPolicyTextProcessor(Log).Parse(merged); }, Log, nameof(Policies)); - private readonly ValueGetOnce>> _policies = new ValueGetOnce>>(); + private readonly GetOnce>> _policies = new GetOnce>>(); private string GetAppPolicies() { diff --git a/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspSettingsReader.cs b/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspSettingsReader.cs index 88606b80d1..19c426f25b 100644 --- a/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspSettingsReader.cs +++ b/Src/Sxc/ToSic.Sxc/Web/ContentSecurityPolicy/CspSettingsReader.cs @@ -59,16 +59,16 @@ private object GetFromPreferredOrDefaultSource(string field) if (_user.IsAnonymous) return GetName("Anonymous"); return ("none", null); }, Log, nameof(SettingPreferred)); - private readonly ValueGetOnce<(string Name, DynamicEntity Settings)> _preferred = new ValueGetOnce<(string, DynamicEntity)>(); + private readonly GetOnce<(string Name, DynamicEntity Settings)> _preferred = new GetOnce<(string, DynamicEntity)>(); /// /// The fallback settings, which will be null if in devMode, because then we shouldn't do a fallback /// private DynamicEntity SettingsDefault => _devMode ? null : _default.Get(() => SettingsRoot?.Get("Default") as DynamicEntity); - private readonly ValueGetOnce _default = new ValueGetOnce(); + private readonly GetOnce _default = new GetOnce(); private DynamicEntity SettingsRoot => _settingsRoot.Get(() => _settingsOrNull?.Get(FieldCSPs) as DynamicEntity, Log, nameof(SettingsRoot)); - private readonly ValueGetOnce _settingsRoot = new ValueGetOnce(); + private readonly GetOnce _settingsRoot = new GetOnce(); } } diff --git a/Src/Sxc/ToSic.Sxc/Web/LightSpeed/LightSpeed.cs b/Src/Sxc/ToSic.Sxc/Web/LightSpeed/LightSpeed.cs index 8cf8a8db85..6311c25d3b 100644 --- a/Src/Sxc/ToSic.Sxc/Web/LightSpeed/LightSpeed.cs +++ b/Src/Sxc/ToSic.Sxc/Web/LightSpeed/LightSpeed.cs @@ -119,7 +119,7 @@ private IList AppPaths(List appStates) return paths; } - private readonly ValueGetOnce> _appPaths = new ValueGetOnce>(); + private readonly GetOnce> _appPaths = new GetOnce>(); private int Duration => _duration.Get(() => { @@ -129,10 +129,10 @@ private IList AppPaths(List appStates) if (!user.IsAnonymous) return AppConfig.DurationUser; return AppConfig.Duration; }); - private readonly ValueGetOnce _duration = new ValueGetOnce(); + private readonly GetOnce _duration = new GetOnce(); private string Suffix => _suffix.Get(GetSuffix); - private readonly ValueGetOnce _suffix = new ValueGetOnce(); + private readonly GetOnce _suffix = new GetOnce(); private string GetSuffix() { @@ -144,16 +144,16 @@ private string GetSuffix() } private string CacheKey => _key.Get(() => Log.Return(() => Ocm.Id(_moduleId, _pageId, UserIdOrAnon, ViewKey, Suffix))); - private readonly ValueGetOnce _key = new ValueGetOnce(); + private readonly GetOnce _key = new GetOnce(); private int? UserIdOrAnon => _userId.Get(() => _block.Context.User.IsAnonymous ? (int?)null : _block.Context.User.Id); - private readonly ValueGetOnce _userId = new ValueGetOnce(); + private readonly GetOnce _userId = new GetOnce(); private string ViewKey => _viewKey.Get(() => _block.Configuration?.PreviewTemplateId.HasValue == true ? $"{_block.Configuration.AppId}:{_block.Configuration.View.Id}" : null); - private readonly ValueGetOnce _viewKey = new ValueGetOnce(); + private readonly GetOnce _viewKey = new GetOnce(); public OutputCacheItem Existing => _existing.Get(ExistingGenerator); - private readonly ValueGetOnce _existing = new ValueGetOnce(); + private readonly GetOnce _existing = new GetOnce(); private OutputCacheItem ExistingGenerator() { @@ -175,7 +175,7 @@ private OutputCacheItem ExistingGenerator() public bool IsEnabled => _enabled.Get(IsEnabledGenerator); - private readonly ValueGetOnce _enabled = new ValueGetOnce(); + private readonly GetOnce _enabled = new GetOnce(); private bool IsEnabledGenerator() { @@ -187,7 +187,7 @@ private bool IsEnabledGenerator() } public LightSpeedDecorator AppConfig => _lsd.Get(() => LightSpeedDecoratorGenerator(AppState)); - private readonly ValueGetOnce _lsd = new ValueGetOnce(); + private readonly GetOnce _lsd = new GetOnce(); private LightSpeedDecorator LightSpeedDecoratorGenerator(AppState appState) { diff --git a/Src/Sxc/ToSic.Sxc/Web/PageService/PageServiceShared.cs b/Src/Sxc/ToSic.Sxc/Web/PageService/PageServiceShared.cs index 89a533a734..d6ae0c7e8c 100644 --- a/Src/Sxc/ToSic.Sxc/Web/PageService/PageServiceShared.cs +++ b/Src/Sxc/ToSic.Sxc/Web/PageService/PageServiceShared.cs @@ -25,7 +25,7 @@ public PageServiceShared(IPageFeatures pageFeatures, IFeaturesService featuresSe public CspOfModule Csp { get; } public string CspEphemeralMarker => _cspEphemeralMarker.Get(() => new Random().Next(100000000, 999999999).ToString()); - private readonly ValueGetOnce _cspEphemeralMarker = new ValueGetOnce(); + private readonly GetOnce _cspEphemeralMarker = new GetOnce(); /// diff --git a/Src/Sxc/ToSic.Sxc/Web/PageService/PageService_Features.cs b/Src/Sxc/ToSic.Sxc/Web/PageService/PageService_Features.cs index 358550fc24..6353744d71 100644 --- a/Src/Sxc/ToSic.Sxc/Web/PageService/PageService_Features.cs +++ b/Src/Sxc/ToSic.Sxc/Web/PageService/PageService_Features.cs @@ -58,7 +58,7 @@ private string[] AddManualResources(string[] keys) } private DynamicEntity WebResources => _webResources.Get(() => (CodeRoot?.Settings as DynamicStack)?.Get(WebResourcesNode) as DynamicEntity); - private readonly ValueGetOnce _webResources = new ValueGetOnce(); + private readonly GetOnce _webResources = new GetOnce(); } }