Created
February 6, 2019 00:19
-
-
Save jfbueno/1d81b4f9bcfe1d97f792a7c7073d781e to your computer and use it in GitHub Desktop.
meuwhere-yield.cs
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
public static IEnumerable<T> MeuWhere<T>(this IEnumerable<T> src, Func<T, bool> predicate) | |
{ | |
foreach(var item in src) | |
if (predicate(item)) | |
yield return item; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment