Querying EDMs with LINQ to Entities

LINQ to Entities is the standard LINQ provider for querying entities within an Entity Data Model. Generally you use the same LINQ syntax for querying Entities, too, so you will not encounter particular difficulties.

Using Standard Query Operators

LINQ to Entities supports standard query operators described in Chapter 24, “LINQ to Objects,” to perform complex query expressions.

The one big difference is about eager loading that is explained after showing the code. As in LINQ to SQL, LINQ to Entities queries return an IQueryable(Of T), unless you convert the result into a different type using extension methods at the end of the query. The following code returns the list of products for the specified category, ...

Get Visual Basic® 2010 Unleashed 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.