যেখানে পদ্ধতিটি একটি পূর্বনির্ধারণের উপর ভিত্তি করে মানগুলির একটি বিন্যাস ফিল্টার করে৷
এখানে, predicate 70 এর উপরে উপাদানের জন্য পরীক্ষা করছে।
Where((n, index) => n >= 70);
উদাহরণ
using System;
using System.Linq;
using System.Collections.Generic;
public class Demo {
public static void Main() {
int[] arr = { 10, 30, 20, 15, 90, 85, 40, 75 };
Console.WriteLine("Array:");
foreach (int a in arr)
Console.WriteLine(a);
// getting elements above 70
IEnumerable myQuery = arr.AsQueryable().Where((n, index) => n >= 70);
Console.WriteLine("Elements above 70...:");
foreach (int res in myQuery)
Console.WriteLine(res);
}
} আউটপুট
Array: 10 30 20 15 90 85 40 75 Elements above 70...: 90 85 75