string[] s = { "test", "hello world", "mamma", "zack", "aaa","xxx" };
// LINQ
var subset = from z in s where z != "hello world"
orderby z descending select z;
int i = 0;
foreach (var l in subset)
{
Response.Write("Item " + i.ToString() + " = " + l + "<br />");
i++;
}
A Southwestern adventurer striking out into the badlands of the Midwest for fun, profit, and for a wife who wouldn't move back to the Southwest :)
Monday, June 15, 2009
My HelloWorld LINQ Example
I know it is sad, but up until today I hadn't ever written a single LINQ query. So, for future prosterity, here is my hello world example.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment