Feeds

Introducing Microsoft LINQ

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

Intelligent flash storage arrays

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). ®

Internet Security Threat Report 2014

More from The Register

next story
PEAK APPLE: iOS 8 is least popular Cupertino mobile OS in all of HUMAN HISTORY
'Nerd release' finally staggers past 50 per cent adoption
Microsoft to bake Skype into IE, without plugins
Redmond thinks the Object Real-Time Communications API for WebRTC is ready to roll
Microsoft promises Windows 10 will mean two-factor auth for all
Sneak peek at security features Redmond's baking into new OS
Mozilla: Spidermonkey ATE Apple's JavaScriptCore, THRASHED Google V8
Moz man claims the win on rivals' own benchmarks
Yes, Virginia, there IS a W3C HTML5 standard – as of now, that is
You asked for it! You begged for it! Then you gave up! And now it's HERE!
FTDI yanks chip-bricking driver from Windows Update, vows to fight on
Next driver to battle fake chips with 'non-invasive' methods
DEATH by PowerPoint: Microsoft warns of 0-day attack hidden in slides
Might put out patch in update, might chuck it out sooner
Ubuntu 14.10 tries pulling a Steve Ballmer on cloudy offerings
Oi, Windows, centOS and openSUSE – behave, we're all friends here
prev story

Whitepapers

Cloud and hybrid-cloud data protection for VMware
Learn how quick and easy it is to configure backups and perform restores for VMware environments.
Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Top 5 reasons to deploy VMware with Tegile
Data demand and the rise of virtualization is challenging IT teams to deliver storage performance, scalability and capacity that can keep up, while maximizing efficiency.
How to simplify SSL certificate management
Simple steps to take control of SSL certificates across the enterprise, and recommendations centralizing certificate management throughout their lifecycle.