Sep 11, 2015

Wrap an object into an IEnumerable of single item

Code:
public static IEnumerable<T> Yield<T>(this T item)
{
    yield return item;
}

No comments:

Post a Comment