using System.Diagnostics.CodeAnalysis; namespace Umbraco.Cms.Core; /// /// Not intended for use in background threads where you should make use of /// /// and instead resolve IPublishedContentQuery from a /// /// e.g. using /// /// /// // Background thread example /// using UmbracoContextReference _ = _umbracoContextFactory.EnsureUmbracoContext(); /// using IServiceScope serviceScope = _serviceProvider.CreateScope(); /// IPublishedContentQuery query = serviceScope.ServiceProvider.GetRequiredService<IPublishedContentQuery>(); /// /// /// public interface IPublishedContentQueryAccessor { bool TryGetValue([MaybeNullWhen(false)] out IPublishedContentQuery publishedContentQuery); }