How to: Navigate Relationships Using Navigation Properties
This topic shows how to navigate relationships through navigation properties. For more information, see Navigation Properties. The example gets all the orders of the contacts whose last name is "Zhou". The Contact.SalesOrderHeader navigation property is used to get the collection of SalesOrderHeader objects for each contact. The same example is shown using each of the following Entity Framework query technologies:
The example in this topic is based on the Adventure Works Sales Model. To run the code in this topic, you must have already added the Adventure Works Sales Model to your project and configured your project to use the Entity Framework. For more information, see How to: Use the Entity Data Model Wizard (Entity Framework) or How to: Manually Configure an Entity Framework Project and How to: Manually Define an Entity Data Model (Entity Framework).
This is the LINQ to Entities example.
This is the Entity SQL example.
This is the query builder method example.