Created
September 18, 2017 12:33
-
-
Save nojaf/3a92866df908c686f72e835da464ad4f to your computer and use it in GitHub Desktop.
yield!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary>Wraps this object instance into an IEnumerable<T> consisting of a single item.</summary> | |
/// <typeparam name="T"> Type of the object. </typeparam> | |
/// <param name="item"> The instance that will be wrapped. </param> | |
/// <returns> An IEnumerable<T> consisting of a single item. </returns> | |
public static IEnumerable<T> Yield<T>(this T item) | |
{ | |
yield return item; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment