Skip to Main Content
Visual Basic 2015 Unleashed
book

Visual Basic 2015 Unleashed

by Alessandro Del Sole
July 2015
Intermediate to advanced content levelIntermediate to advanced
1300 pages
87h 27m
English
Sams
Content preview from Visual Basic 2015 Unleashed

LINQ Examples

To understand why LINQ is revolutionary, the best way is to begin with some code examples. In the next chapters, you see a huge quantity of code snippets, but this chapter offers basic queries to provide a high-level comprehension. Imagine you have a Person class exposing the FirstName, LastName, and Age properties. Then, imagine you have a collection of Person objects, of type List(Of Person), called People. Last, imagine you want to extract from the collection all Person instances whose LastName property begins with the letter D. This scenario is performed via the following code snippet that uses a LINQ query:

' "People" is of type List(Of Person)Dim peopleQuery = From pers In People                  Where ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Visual Basic 2015

Beginning Visual Basic 2015

Bryan Newsome

Publisher Resources

ISBN: 9780134196664Purchase book