:
public static class Extensions
{
public static IEnumerable<T> AsEnumerable<T>(this T item)
{
yield return item;
}
}
, , Enumerable.Repeat, , , ( - ). :
public static IEnumerable<T> MakeEnumerable<T>(params T[] items)
{
return items;
}
And that, of course, works if you call it with one argument. But perhaps within the framework there is already something similar that I have not yet discovered.
phoog source
share