Feeds

Introducing Microsoft LINQ

A new approach to data query in the .NET world.

Combat fraud and increase customer satisfaction

Book review Microsoft's Language Integrated Query (also known as LINQ), is one of the key features on the .NET horizon. Already out as a beta, it's slated for release as part of Visual Studio 2008 (which goes under the code name of Orcas, which conjures images of packs of killer whales rather than shrink-wrapped development software).

However, Microsoft has done a good job of whetting developers' appetites, and there's plenty of interest in LINQ already.

As the name implies, LINQ integrates query capabilities (both relational and XML querying) into the key .NET programming languages C# and Visual Basic. This moves way beyond supplying useful and highly functional APIs for querying relational and XML data stores and gets us into the realms of structured querying as syntactic elements of C# and VB. With LINQ, you write very high-level code that embeds queries that are compiled as part of the language. And no, it's a lot more than simply embedding SQL or XQuery strings into your applications.

Obviously, there's a lot that has to go on under the covers for all of this to work – you need more than a generous sprinkling of syntactic sugar for it to piece together. This book takes a stab both at showing how LINQ works and at investigating the changes in C# and Visual Basic and the next generation of .NET that enable it to happen. But the starting point is explaining what LINQ is, so the first chapter includes a round-up of LINQ, showing what it is, how it works, and offering some examples of the different flavours of LINQ (objects, XML and ADO.NET).

More detailed chapters follow this, on the specific implementations in C# and Visual Basic. In the case of C# there's a quick run through of language features introduced in version 2.0 and then on to the major new features included in C# 3.0, including type inference, lambda expressions, extension methods and, of course, query expressions. There's a corresponding chapter devoted to Visual Basic 9.0, which includes a section on feature differences with C# 3.0.

Once these preliminaries are out of the way the emphasis is firmly on LINQ again, with a long chapter on details of the syntax, including the query operators (including filtering, joining, aggregating and so on that you're familiar with from SQL) and conversion operators (which enable you to treat the result of a query as a List, Enumeration, Dictionary etc). LINQ to ADO.NET also gets a chapter, which provides a link between LINQ and the primary existing .NET mechanism for interfacing to relational data. LINQ to XML also gets a chapter.

It's not just in getting to the data easily that LINQ provides value; it's also in bridging the gap between the relational view of the world and object view (computer scientists like to call this the impedance mismatch, which confuses electrical engineers no end). The need to be able to persist objects to relational databases is the sort of thing that is normally handled by an object-relational mapping (ORM) layer (and in the Java world it's Hibernate that is the best known ORM solution). LINQ provides a new take on this too, making it even more of an attractive proposition.

However, while there's a lot of good material in this book, and it does indeed provide a fairly wide introduction to LINQ, it's not exactly a gripping read. The book is a bit dry and manual-like, with large chunks of syntax-related reference material.

Introducing Microsoft LINQ

Microsoft LinqVerdict: If you're desperate to get a handle on LINQ (and remember, it's still only in beta), then this is sure to hold your interest.

Authors: Paolo Pialorsi and Marco Russo

Publisher: Microsoft Press

ISBN: 0735623910

Media: Book

List Price: £23.99

Current Reg price: £15.83 inc. VAT (discount 34%)

Buy this book at Register Books at Reg Developer's special discounted price (subject to change). ®

High performance access to file storage

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Batten down the hatches, Ubuntu 14.04 LTS due in TWO DAYS
Admins dab straining server brows in advance of Trusty Tahr's long-term support landing
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
Windows 8.1, which you probably haven't upgraded to yet, ALREADY OBSOLETE
Pre-Update versions of new Windows version will no longer support patches
Microsoft TIER SMEAR changes app prices whether devs ask or not
Some go up, some go down, Redmond goes silent
Red Hat to ship RHEL 7 release candidate with a taste of container tech
Grab 'near-final' version of next Enterprise Linux next week
Ditch the sync, paddle in the Streem: Upstart offers syncless sharing
Upload, delete and carry on sharing afterwards?
prev story

Whitepapers

Designing a defence for mobile apps
In this whitepaper learn the various considerations for defending mobile applications; from the mobile application architecture itself to the myriad testing technologies needed to properly assess mobile applications risk.
3 Big data security analytics techniques
Applying these Big Data security analytics techniques can help you make your business safer by detecting attacks early, before significant damage is done.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Securing web applications made simple and scalable
In this whitepaper learn how automated security testing can provide a simple and scalable way to protect your web applications.