diff --git a/src/Umbraco.Core/Extensions/ObjectExtensions.cs b/src/Umbraco.Core/Extensions/ObjectExtensions.cs
index c53eee27a5..0497d2cec4 100644
--- a/src/Umbraco.Core/Extensions/ObjectExtensions.cs
+++ b/src/Umbraco.Core/Extensions/ObjectExtensions.cs
@@ -26,6 +26,15 @@ public static class ObjectExtensions
private static readonly char[] _numberDecimalSeparatorsToNormalize = ['.', ','];
private static readonly CustomBooleanTypeConverter _customBooleanTypeConverter = new();
+ ///
+ /// Returns an enumerable containing only the input object.
+ ///
+ /// The input object.
+ /// The type of the enumerable.
+ /// An enumerable containing only the input object.
+ [Obsolete("Please replace uses of this extension method with Enumerable.Repeat(input, 1). This extension method is no longer used in Umbraco and is scheduled for removal in Umbraco 19.")]
+ public static IEnumerable AsEnumerableOfOne(this T input) => Enumerable.Repeat(input, 1);
+
///
/// Returns an XML serialized safe string representation for the value and type.
///
diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/ObjectExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/ObjectExtensionsTests.cs
index 1461364d02..38c233e2b9 100644
--- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/ObjectExtensionsTests.cs
+++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/ObjectExtensionsTests.cs
@@ -1,11 +1,7 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
-using System;
-using System.Collections.Generic;
using System.Globalization;
-using System.Linq;
-using System.Threading;
using Microsoft.Extensions.Primitives;
using NUnit.Framework;
using Umbraco.Cms.Core.PropertyEditors;
@@ -31,6 +27,17 @@ public class ObjectExtensionsTests
private CultureInfo _savedCulture;
+ [Test]
+ public void Can_Create_Enumerable_Of_One()
+ {
+ var input = "hello";
+#pragma warning disable CS0618 // Type or member is obsolete
+ var result = input.AsEnumerableOfOne();
+#pragma warning restore CS0618 // Type or member is obsolete
+ Assert.AreEqual(1, result.Count());
+ Assert.AreEqual("hello", result.First());
+ }
+
[Test]
public void Can_Convert_List_To_Enumerable()
{