Update ObjectExtension.cs

This commit is contained in:
Lightczx
2023-07-16 21:56:07 +08:00
parent e90f76ead8
commit 147312c289

View File

@@ -16,9 +16,13 @@ internal static class ObjectExtension
/// <typeparam name="T">数据类型</typeparam>
/// <param name="source">源</param>
/// <returns>数组</returns>
[Obsolete("Use C# 12 Collection Literals")]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static T[] ToArray<T>(this T source)
{
// TODO: use C# 12 collection literals
// [ source ]
// and mark this as Obsolete
return new[] { source };
}
}