I have about 200 run time errors just based on this UmbracoHelper. I have googled/forumed enough. But I just can't seem to find the correct equivalent of this below line(s).
Any links to the documentation or solutions will be of great help. Thanks!
var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current);
var rootNodes = umbracoHelper.TypedContentAtRoot();
It is usually possible to get the same values from other places rather than using the UmbracoHelper - IPublishedContentQuery also exposes the ContentAtRoot method, and (I'm guessing) would be a lighter dependency
UmbracoHelper in Version 8.5?
Hello All,
I have about 200 run time errors just based on this UmbracoHelper. I have googled/forumed enough. But I just can't seem to find the correct equivalent of this below line(s).
Any links to the documentation or solutions will be of great help. Thanks!
Hi Ram, it depends on where you're accessing the helper, and what you're using it for, generally though I'd lean on DI and inject the helper:
That said though, there doesn't appear to be a
TypedContentAtRoot
method on the UmbracoHelper class in v8 (it did exist in v7)Given that, you could do something like this:
It is usually possible to get the same values from other places rather than using the UmbracoHelper - IPublishedContentQuery also exposes the ContentAtRoot method, and (I'm guessing) would be a lighter dependency
Hi @Nathan,
Thanks a lot for your response! For now, this code is in a dll.
I shall try it out.
Appreciate your help!
is working on a reply...