Chapter 2. C# and VB.NET language enhancements

This chapter covers:

  • Key C# 3.0 and VB.NET 9.0 languages features for LINQ
  • Implicitly typed local variables
  • Object initializers
  • Lambda expressions
  • Extension methods
  • Anonymous types

In chapter 1, we reviewed the motivation behind LINQ and introduced some code to give you an idea of what to expect. In this chapter, we’ll present the language extensions that make LINQ possible and allow queries to blend into programming languages.

LINQ extends C# and VB.NET with new constructs. We find it important that you discover these language features before we get back to LINQ content. This chapter is a stepping stone that explains how the C# and VB.NET languages have been enriched to make LINQ possible. ...

Get LINQ in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.