The .NET Language Integrated Query Project (LINQ)

To start the Calgary Code Camp 2006 I’m sitting in on Daniel Carbajal‘s presentation on LINQ. I’ve seen a bit on this before, but I’m interested in what new things I’m going to be able to pick up.

The example:

var query = from s in names
where s[0] == ‘F’
orderby s
select s.ToUpper();
shows a very nice and easy way to filter a selection based on the first letter of the s objects. Also note that the variable ‘query’ is the one that you will want to work with to see the results of the query. If you work with the name object (which in this case was an array variable) after running that query you will not be able to see the results in the query result set variable.

When you are doing DLinq queries you can debug (new to the May CTP) the queries that you send to the database and see them in a SQL Query Visualizer and even better you can run the query and see the results, for one or more queries, in a grid formatted visualizer.

XLinq for XML Data is very cool. I hate writing code that requires you walk the XML document when you’re searching for a specific element or group of elements.

Overall, good presentation. 200 Level introduction to new technology.