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

Combat fraud and increase customer satisfaction

More from The Register

next story
OpenBSD founder wants to bin buggy OpenSSL library, launches fork
One Heartbleed vuln was too many for Theo de Raadt
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Ubuntu 14.04 LTS: Great changes, but sssh don't mention the...
Why HELLO Amazon! You weren't here last time
Got Windows 8.1 Update yet? Get ready for YET ANOTHER ONE – rumor
Leaker claims big release due this fall as Microsoft herds us into the CLOUD
Patch iOS, OS X now: PDFs, JPEGs, URLs, web pages can pwn your kit
Plus: iThings and desktops at risk of NEW SSL attack flaw
Next Windows obsolescence panic is 450 days from … NOW!
The clock is ticking louder for Windows Server 2003 R2 users
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
Red Hat to ship RHEL 7 release candidate with a taste of container tech
Grab 'near-final' version of next Enterprise Linux next week
Apple inaugurates free OS X beta program for world+dog
Prerelease software now open to anyone, not just developers – as long as you keep quiet
prev story

Whitepapers

Mobile application security study
Download this report to see the alarming realities regarding the sheer number of applications vulnerable to attack, as well as the most common and easily addressable vulnerability errors.
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.
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.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.