int[] array = { 1, 2, 3, 4, 5, 6, 7, 8 };
var query = from x in array
where Predicate
select x;
foreach (int item in query)
Console.WriteLine(item);
bool Predicate(int n)
{
if (n % 2 == 0)
return true;
return false;
}
int[] array = { 1, 2, 3, 4, 5, 6, 7, 8 };
var query = array.Where(Predicate);
foreach (int item in query)
Console.WriteLine(item);