Anyone here have tried accessing page url inside the background task ?
I tried this code but no luck . Anyone can help me what approach should I need to do here ? Thanks in advance
> public IPublishedContent GetPage(int id)
> {
> using (var cref = _umbracoContextFactory.EnsureUmbracoContext())
> {
> var cache = cref.UmbracoContext.Content;
> return cache.GetById(id);
> }
> }
s
Sander L
09/09/2024, 3:29 PM
Is the page vary by culture? Then you need to set the variation context accessor to the right culture
m
Markus Johansson
09/10/2024, 6:42 PM
Looks like the approach that I use most of the time, do you get any errors? Or just nothing back from the cache?