I have 3 objects in my model thus:
Customer 1-----* Region 1-----* Branch
To get the Customer from the Branch in code seems simple enough:
branch.Region.Customer
I would need to get all of the Branches belonging to a given Customer though and suspect that customer.Regions.Branches would not work due to customer.Regions being a collection.
Having Customer link directly to Branch would be redundant for me as the region already contains the customer information (each customer has different region boundaries so there is no mileage in separating the Regions out here.)
I know that in ActiveRecord as used in Ruby on Rails this would be possible using "has_many_through
" but can it be done in the ADO.NET Entity Framework? If so how?
Thanks a lot for reading all of this.