Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi.
There has been a lot of topics for Umbraco in custom classes and I can't figure out the correct way to implement a static class (for extensions).
public static class CompositionExtensions { private static readonly IUmbracoContextFactory _context; public static void SetUmbracoRoutes(this Composition composition) { var rootNodes = _context.EnsureUmbracoContext().UmbracoContext.ContentCache.GetByXPath("root/");
I saw some link to Lazy<> and LazyInitializer but did not get the context of how to actually implement it.
Any help would be great!
Found another solution by using IComponent
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Umbraco in static class
Hi.
There has been a lot of topics for Umbraco in custom classes and I can't figure out the correct way to implement a static class (for extensions).
I saw some link to Lazy<> and LazyInitializer but did not get the context of how to actually implement it.
Any help would be great!
Found another solution by using IComponent
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.