Restored and obsoleted removed extension method AsEnumerableOfOne.

This commit is contained in:
Andy Butland
2025-10-15 20:22:58 +02:00
parent 2503cabbce
commit f1f2f702c0
2 changed files with 20 additions and 4 deletions

View File

@@ -26,6 +26,15 @@ public static class ObjectExtensions
private static readonly char[] _numberDecimalSeparatorsToNormalize = ['.', ','];
private static readonly CustomBooleanTypeConverter _customBooleanTypeConverter = new();
/// <summary>
/// Returns an enumerable containing only the input object.
/// </summary>
/// <param name="input">The input object.</param>
/// <typeparam name="T">The type of the enumerable.</typeparam>
/// <returns>An enumerable containing only the input object.</returns>
[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<T> AsEnumerableOfOne<T>(this T input) => Enumerable.Repeat(input, 1);
/// <summary>
/// Returns an XML serialized safe string representation for the value and type.
/// </summary>