In response to Slauma\'s answer to my question about running applications that use EF on Windows XP I am converting my application back from Entity Framework 5.0 to use Entit
When you enable migrations for MVC5 web applications, you get the following comment in the Seed method of the configuration:
// You can use the DbSet.AddOrUpdate() helper extension method
My initial stab at this was to user DbSet
. This will lead to the same error message (and rightly so) as the one raised in this question.
The fix is to read the rest of the comment and use the context parameter passed into the Seed function:
context.MyEntity.AddOrUpdate();