7
好了,所以我刚刚升级直通的NuGet到EF代码第一次4.1,现在我得到我JobSiteContext.cs类中下面的生成错误:EF 4.1代码第一次发行后升级
“‘DbDatabase’这个名字的确
public class JobSiteContext : DbContext
{
public DbSet<JobSite.Models.Job> Jobs { get; set; }
public DbSet<JobSite.Models.Location> Locations { get; set; }
public DbSet<JobSite.Models.Profile> Profiles { get; set; }
public JobSiteContext()
{
// Instructions:
// * You can add custom code to this file. Changes will *not* be lost when you re-run the scaffolder.
// * If you want to regenerate the file totally, delete it and then re-run the scaffolder.
// * You can delete these comments if you wish
// * If you want Entity Framework to drop and regenerate your database automatically whenever you
// change your model schema, uncomment the following line:
DbDatabase.SetInitializer(new DropCreateDatabaseIfModelChanges<JobSiteContext>());
}
}
任何人都可以点我在正确的方向:在目前情况下”
这里是我的代码不存在?
感谢保罗
所以我看到“DbDatabase”到“数据库”的:) 重命名。这个类也移动到了'System.Data.Entity'命名空间,以及数据库初始化类。 谢谢! – 2011-03-24 16:43:06