Skip to content

Instantly share code, notes, and snippets.

@aershov24
Created September 23, 2020 06:11
Show Gist options
  • Save aershov24/2013453055efcb07ee31330ea187078b to your computer and use it in GitHub Desktop.
Save aershov24/2013453055efcb07ee31330ea187078b to your computer and use it in GitHub Desktop.
Markdium-60 .NET Interview Questions Devs Must Focus On (ANSWERED)
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