0

The models look like this: Customer (Model) - Order (Model) -- Product (Model) --- Color (Model) - Name (Property)

When listing the details of Product, I want to show the Name of Customer (Name is a property of the model Customer).

The code I'm using is

db.Products.Include("Order").Include("Customer").Include("Color").Where('my where query')

The error message I got is that Product doesn't have a navigation property with Customer. How can I get the properties of Product?

I'm using Entity Framework 4.3.1 with SQL Azure backend.

Jim
  • 1,695
  • 2
  • 23
  • 42

1 Answers1

1

You can use dot notation in Include:

db.Products.Include("Order.Customer").Include("Color").Where(...)
Gert Arnold
  • 105,341
  • 31
  • 202
  • 291