Easiest way to query relational data
Posted: Fri 05 Feb 2010 22:28
Given a many to many relationship ( one customer has many Reservations and a Reservation can belong to more than one customer)
Customer Reservation
Whats the easiest way to query Customers and their corresponding Reservations and vica versa ( Using linq to entities)
There is a great example of a single hop:
var query = from it in context.products.Include("ProductCategories")
orderby it.productcategories.CategoryName, it.ProductName
select it;
I want to be able to navigate from one entity to another no matter how far the relation is.
Customer Reservation
Whats the easiest way to query Customers and their corresponding Reservations and vica versa ( Using linq to entities)
There is a great example of a single hop:
var query = from it in context.products.Include("ProductCategories")
orderby it.productcategories.CategoryName, it.ProductName
select it;
I want to be able to navigate from one entity to another no matter how far the relation is.