LINQ Basic Sample with arrays

Tuesday, October 6, 2009


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LINQSamp1
{
class Program
{
static void Main()
{
int[] ages = { 47, 45, 53, 57,44,63,66 };
IEnumerable seniorcitizen =
from n in ages
where n >50
select n;
foreach (var x in seniorcitizen)
Console.Write("Senior Citizen aged:{0}\n", x);
Console.Read();
}
}
}




www.codecollege.NET

0 comments

Post a Comment

LinkWithin

Blog Widget by LinkWithin

Recommended Books