Clean up extension methods (#17051)
Co-authored-by: Andy Butland <abutland73@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user