Given this extremely simple model:
public class MyContext : BaseContext
{
public DbSet Foos { get; set; }
public DbSet Bars { g
I know it's a bit late... However, ill post this here. Since i too got horribly annoyed with this. Just tell EF to Include the required field.
Notice the SMALL change
using (var context = new MyContext())
{
var foo = context.Foos.Include("Bar").Find(id);
foo.Data = 2;
context.SaveChanges(); //Crash here
}