Implement the “Where” method in C# Technology Community › Category: C# › Implement the “Where” method in C# 0 Vote Up Vote Down VietMX Staff asked 4 years ago Consider: public static IEnumerable<T> Where<T>(this IEnumerable<T> items, Predicate< T> prodicate) { foreach(var item in items) { if (predicate(item)) { // for lazy/deffer execution plus avoid temp collection defined yield return item; } } }