I\'ve narrowed this down to some issue between Code First and Database first EF, but I\'m not sure how to fix it. I\'ll try to be as clear as I can, but I honestly am missin
In my case I was incorrectly defining a primary key made up of two foreign keys like this:
HasKey(x => x.FooId);
HasKey(x => x.BarId);
HasRequired(x => x.Foo)
.WithMany(y => y.Foos);
HasRequired(x => x.Bar);
The error I was getting was, "invalid column name Bar_ID".
Specifying the composite primary key correctly fixed the problem:
HasKey(x => new { x.FooId, x.BarId });
...