O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

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

Simplified Use of LINQ Extension Methods with the LINQ Query Syntax

There is not much left to say. I hope you enjoyed this chapter even if I possibly put the cart before the horse—and if you are familiar with the Porsche 911, you know that that is not necessarily a bad thing to do! You’ll probably need only a brief glance to understand what the Visual Basic compiler does with a LINQ expression and how it changes the expression in combined extension methods (at least with LINQ to Objects).

The query in the following example uses the same method combination as the example in the previous section, but uses a simplified SQL-like syntax:

Public Sub combinedExtensionMethods_à_la_LINQ()

    Dim resultList = From oneContact In Contacts
                        Where oneContact.location ...

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