O'Reilly logo

LINQ For Dummies® by John Paul Mueller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Considering the .NET Language Extensions

In this chapter

  • Understanding the language extensions

  • Using lambda expressions

  • Working with the IEnumerable and IEnumerable<T> interfaces

  • Considering object initializers

  • Considering collection initializers

  • Using extension methods

  • Using partial methods

  • Understanding expression trees

  • Defining query extensions

LINQ doesn't appear as part of older versions of Visual Studio. Yes, you can use LINQ in these older versions, but you must use special techniques to do it — not much is automatic (see Chapter 5 for details). Part of the reason that LINQ works the way it does is the addition of language extensions to .NET Framework. The language extensions make it possible for .NET Framework to support LINQ and for you to create queries of various types.

This chapter provides an overview of the major .NET language extensions from the C# developer's perspective. Chapter 4 provides information about the differences between C# and Visual Basic .NET from the Visual Basic .NET developer's perspective. Although the two languages do support the same basic features, you'll find that Visual Basic .NET provides some additional automation that C# doesn't and C# provides flexibility that Visual Basic .NET doesn't. Either language will perform all basic queries and most complex queries without any problem.

The chapter begins with an overview of the extensions in .NET Framework 3.5. The sections that follow provide additional details on each of these extensions. In many ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required