Obsolete GetAtRoot on DocumentCache (#20514)
Obsolete GetAtRoot on DocumentCache.
This commit is contained in:
@@ -42,6 +42,9 @@ public sealed class DocumentCache : IPublishedContentCache
|
||||
|
||||
public IPublishedContent? GetById(Guid contentId) => GetByIdAsync(contentId).GetAwaiter().GetResult();
|
||||
|
||||
[Obsolete("This method is no longer used in Umbraco and is not defined on the interface. " +
|
||||
"Any usage can be replaced with a call to IDocumentNavigationQueryService.TryGetRootKeys to retrieve the document keys, " +
|
||||
"with each key passed to IPublishedContentCache.GetById to retrieve the IPublishedContent instances. Scheduled for removal in Umbraco 19.")]
|
||||
public IEnumerable<IPublishedContent> GetAtRoot(bool preview, string? culture = null)
|
||||
{
|
||||
if (_documentNavigationQueryService.TryGetRootKeys(out IEnumerable<Guid> rootKeys) is false)
|
||||
|
||||
@@ -8,7 +8,6 @@ using Umbraco.Cms.Core.PropertyEditors;
|
||||
using Umbraco.Cms.Core.PublishedCache;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Sync;
|
||||
using Umbraco.Cms.Infrastructure.HybridCache;
|
||||
using Umbraco.Cms.Tests.Common.Builders;
|
||||
using Umbraco.Cms.Tests.Common.Builders.Extensions;
|
||||
using Umbraco.Cms.Tests.Common.Testing;
|
||||
@@ -127,7 +126,6 @@ public class DateTimePropertyEditorTests : UmbracoIntegrationTest
|
||||
|
||||
Assert.IsTrue(publishResult.Success);
|
||||
|
||||
var test = ((DocumentCache)PublishedContentCache).GetAtRoot(false);
|
||||
var publishedContent = await PublishedContentCache.GetByIdAsync(createContentResult.Result.Content.Key, false);
|
||||
Assert.IsNotNull(publishedContent);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user