using System; using System.Collections.Generic; using System.Dynamic; using System.Reflection; namespace Queries { public static class MyLinq { public static IEnumerable Filter(this IEnumerable source, Func predicate) { // define a customized filter extension for LINQ // demonstrate how to create a customized LINQ filter var result = new List(); foreach (var item in source) { if (predicate(item)) { result.Add(item); } } return result; } } }