Sunday, August 16, 2009

LINQ

I was bored, and I realized that this blog was desperately in need of resuscitation (once again) and so I decided to post on whatever I was doing right now, which happened to be experimenting with LINQ. Now, I've only just started, so I think I'll put up some basic commands here.


List list = new List();
for (int i = 0; i < 10; i++)
 list.Add(i);

IEnumerable oddIntegers = from inte in list where inte % 2 != 0 select inte;
foreach (int integer in oddIntegers)
 MessageBox.Show(integer.ToString());


On second thoughts, I am not going to be putting up anything here. You can do a better job looking it up somewhere :)

Sundar.

2 comments:

Vatsala said...

You were doing this on a Sunday? :O

vjai said...

ur an asshole!!