O'Reilly logo

WCF 4.0 Multi-tier Services Development with LINQ to Entities by Mike Liu

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

Deferred (lazy) loading versus eager loading

In one of the above examples we retrieved the category name of a product using this expression:

p.Category.CategoryName == "Beverages"

Even though there is no field called categoryname in the Products table we can still get the category name of a product because there is an association between the Products and Category tables. In the Northwind.edmx design pane, click on the line that connects the Products table and the Categories table and you will see all of the properties of the association. Note that its Referential Constraint properties are Category.CategoryID -> Product.CategoryID, meaning that category ID is the key field to link these two tables.

Because of this association we can retrieve the ...

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