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