class LinQ
{
int[] numbers = { 5, 10, 8, 3, 6, 12};
//METHOD SYNTAX
IEnumerable<int> numQuery = numbers.Where(n => (n%2==0)).OrderBy(n==>n);
//QUERY SYNTAX
IEnumerable<int> numQuery = from n in numbers
where n%2 == 0
order by n
select n;
}
{
int[] numbers = { 5, 10, 8, 3, 6, 12};
//METHOD SYNTAX
IEnumerable<int> numQuery = numbers.Where(n => (n%2==0)).OrderBy(n==>n);
//QUERY SYNTAX
IEnumerable<int> numQuery = from n in numbers
where n%2 == 0
order by n
select n;
}
No comments:
Post a Comment