I wonder if you could help. I get the above error when I call .Include()
. It breaks when I include tblMemberships
.
this.dbContext.Configuration.LazyLoadingEnabled = false;
List<tblCustomerInfo> customers = this.dbContext.tblCustomerInfoes.Include("tblUsers").Include("tblMemberships").ToList();
The reason is because the navigation property between tblCustomerInfo
and tblMemberships
does not exist. tblUsers
is the link between the other two tables.
Customer -- 1:* -- User -- 1:* -- Membership
(Sorry, can't include image as my reputataion < 10).
My questions are:
- What do I need to do in order to have
tblMemberships
included? - Is this a recommended way of retrieve data or I should break it up into two queries? Or the design is totally rubbish?
I am using EF5, ASP .NET MVC 4
Kindly advise. Thank you.