LINQ Learning Guide: LINQ and Visual Studio 2008's new language features

This section of the LINQ Learning Guide examines the new features in Visual Basic 2008 and C# 3.0 that help make LINQ possible.




   LINQ Quick Start
   LINQ and Visual Studio 2008's new language features
   LINQ Providers
   LINQ and Web applications
   LINQ to Objects
   LINQ to XML
   LINQ to SQL
   LINQ to DataSet
   LINQ to Entities
   Third-party LINQ Implementations


LINQ and Visual Studio 2008's new language features

In order to accommodate LINQ, Microsoft had to introduce some new features to Visual Basic 2008 and C# 3.0. The following articles introduce these four language-agnostic features and offer details on how well they work with Visual Studio 2008's multi-targeting. From here, the next section of the LINQ Learning Guide discusses how to build a LINQ provider.

Learn the basics of LINQ (SingingEels)
This concise introduction to LINQ provides some thoughts on using extension methods and lambda expressions (more on those below) for those who opt to take the plunge.

LINQ beyond queries: Strong-typed refection (TheServerSide.NET)
LINQ makes queries a first-class concept. LINQ can be used for way more than just querying, though -- think lambda expressions and strong-typed reflection. (Code samples are in C#.)

New VS 2008 language feature: Extension methods (Scott Guthrie)
As Guthrie explains, "Extension methods allow developers to add new methods to the public contract of an existing CLR type, without having to sub-class it or recompile the original type. Extension Methods help blend the flexibility of 'duck typing' support popular within dynamic languages today with the performance and compile-time validation of strongly-typed languages."

Visual Basic team offering extension methods tutorials (
Extension methods allow Visual Basic 2008 developers to put custom functionality into types authored by someone else. Here we link to a six-part Extension Methods tutorial.

On extension methods in C# and .NET Framework 3.5 (
Blogger Alex Hoffman's "Adventures in .NET 3.5" offers quite a bit of advice for the C# architect on working with extensions methods.

New Visual Studio 2008 language feature: Lambda expressions (Scott Guthrie)
Again, as Guthrie explains, "Lambda Expressions provide a more concise, functional syntax for writing anonymous methods. They…provide a very compact and type-safe way to write functions that can be passed as arguments for subsequent evaluation."

New Visual Studio 2008 language feature: Query syntax (Scott Guthrie)
Once again, Guthrie put it best: "Query syntax is convenient declarative shorthand for expressing queries using the standard LINQ query operators. It offers a syntax that increases the readability and clarity of expressing queries in code, and can be easy to read and write correctly….Under the covers the C# and VB compilers take query syntax expressions and translate them into explicit method invocation code…"

LINQ and query expressions (Charlie Calvert)
This post focuses on query expression syntax itself and the underlying method calls that are created after a query expressions is translated

Using Distinct and avoiding lambdas (Charlie Calvert)
This article focuses on how C# programmers can use certain query expressions, such as Distinct(), as a means of avoiding lambda expressions, which, in this author's mind, are difficult to write.

New Visual Studio 2008 language feature: Anonymous types (Scott Guthrie)
To paraphrase Guthrie this time, Anonymous types let programmers define CLR types within code, without establishing a formal class declaration of the type.

Using C# 3.0 from .NET Framework 2.0 and Using extension methods in .NET Framework 2.0 projects (Daniel Moth)
Thanks to multi-targeting, programmers can use Visual Studio 2008, and all its features, with older versions of the .NET Framework. These articles provides an explanation as to what new LINQ features and implementations in Visual Studio 2008 will, and will not, work when programming in .NET 2.0.

The final three resources in this section of the LINQ Learning Guide focus specifically on using LINQ within Visual Basic 2008.

LINQ and Visual Basic 2008 video series (Microsoft)
These 10 videos cover the basics of LINQ and some of the main LINQ to SQL and LINQ to XML functionality that will be of interest to Visual Basic 2008 programmers.

Visual Basic LINQ syntax in Visual Studio 2008 (Microsoft)
This Channel 9 video with Amanda Silver and Beth Massi of the VB team focuses specifically on Joins and Aggregates syntax.

Visual Basic LINQ hands-on labs for Visual Studio 2008 (Microsoft)
These Microsoft Word documents walk Visual Basic programmers through LINQ features such as the Standard Query Operator. "[S]ee how these features can be used against in-memory collections, connected databases, and XML documents," the description reads.


*** Go on to the next section of the LINQ Learning Guide: LINQ Providers

Dig Deeper on Visual Studio 2008 and Language Integrated Query (LINQ)

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.