I\'m sorry for the repetition. I\'m heading with a same problem but still could not handle it. I\'m using Angularjs framework and Asp.net mvc.
My person class:
You can strongly type your inclusion, which will give you hints as to whether or not your object structure is correctly related. This solves any "magic strings" issues, such as your table being named Users instead of User inside of your EF context, after including DbExtension
.
using System.Data.Entity.DbExtension;
model.People = dc.People.Include(c => c.User).ToList();
However, if you are using ObjectContext
instead of DbContext, you may be stuck with magic strings. That said, EF will "pluralize" most names, so your table is most likely named "Users". Check to see if the table exists as dc.Users
and, if it does, change your magic string to match.
model.People = dc.People.Include("Users").ToList();