using System; using System.Collections.Generic; namespace ConsoleApp1 { static class MyLinq { public static IEnumerable Where(this int[] arr, Func cond) { int[] result = new int[arr.Length]; int j = 0; for (int i = 0; i < arr.Length; i++) if (cond(arr[i])) result[j++] = arr[i]; Array.Resize(ref result, j); return result; } } class Program { static void Main(string[] args) { int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; var query = from x in arr where x % 2 == 0 select x; foreach (int x in query) Console.Write(x + "\t"); } } }