Clean up extension methods (#17051)

Co-authored-by: Andy Butland <abutland73@gmail.com>
This commit is contained in:
Ronald Barendse
2025-05-05 14:53:26 +02:00
committed by GitHub
parent 44d9f5ac2e
commit 2dced37117
28 changed files with 187 additions and 1157 deletions

View File

@@ -1,6 +1,4 @@
using Umbraco.Cms.Core.Extensions;
using Umbraco.Cms.Core.Scoping;
using Umbraco.Extensions;
namespace Umbraco.Cms.Core.DynamicRoot.QuerySteps;
@@ -30,7 +28,9 @@ public class NearestAncestorOrSelfDynamicRootQueryStep : IDynamicRootQueryStep
}
using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true);
var result = (await _nodeFilterRepository.NearestAncestorOrSelfAsync(origins, filter))?.ToSingleItemCollection() ?? Array.Empty<Guid>();
var result = (await _nodeFilterRepository.NearestAncestorOrSelfAsync(origins, filter)) is Guid key
? [key]
: Array.Empty<Guid>();
return Attempt<ICollection<Guid>>.Succeed(result);
}