Is there a way to apply Where clauses on to the Included child tables?
Example:
I have a Customers
entity set and and Addresses
entity set, and I've appropriately decorated the metadata class with the [Include]
attribute. I can easily filter on a property of Customer, such as last name...
public IQueryable<Alphagram> GetCustomersWithAddresses()
{
return this.ObjectContext.Customers.Include("Address")
.Where(w => w.LastName == "Smith")
}
But say I wanted to also filter on a property of he Addresses child table, such Address.City? Addresses exists as a property of Customers, but intellisense doesn't pick up any of the columns of Addresses.
Am I better off using joins instead of Include?