Wednesday, August 08, 2007

The future is Linq and Linq to SQL

I have been playing with VS 2008 Beta 2 all morning. Where to being. I will post some more specifics later but Linq - wow.

I have read some propeller heads not liking Linq to SQL, because it isn't a true ORM, whatever that means. Me, I like it. It gives enough abstraction to handle the meanial tasks, but gives me enough flexibility to let me do what I want, and not have to buggar around with config files.

Get used to seeing code like this:

var totalInvoiceValue = db.Invoices.Where( cust => cust.City == "London" ).Sum( cust => cust.ExtendedPrice );

In a nut shell, that is all you would have to do (once the mappings are setup and thats Visual) to get all the sum of all invoices for London. No more query strings. Very nice.

It is my intention to door some more posts around Linq as I get more into it, mostly so I can write down my thoughts as I find having to explain something in words help me get a better grasp of it too, and if it is useful to others along the way then all the better.

But until then, do yourself a favour and download the beta and start playing.

No comments: