Skip to content

Instantly share code, notes, and snippets.

@aershov24
Created September 23, 2020 05:52
Show Gist options
  • Save aershov24/88b02fa3d77181d9268e03fb3ddf661e to your computer and use it in GitHub Desktop.
Save aershov24/88b02fa3d77181d9268e03fb3ddf661e to your computer and use it in GitHub Desktop.
Markdium-
public static IEnumerable Where(this IEnumerable items, Predicate< T> prodicate)
{
foreach(var item in items)
{
if (predicate(item))
{
// for lazy/deffer execution plus avoid temp collection defined
yield return item;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment