Pau*_*own 7 entity-framework code-first ef-code-first
好的,所以我刚刚通过NuGet升级到EF Code First 4.1,现在我的JobSiteContext.cs类中出现了以下构建错误:
"当前上下文中不存在名称'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>());
}
}
Run Code Online (Sandbox Code Playgroud)
谁能指出我正确的方向?
谢谢保罗
归档时间: |
|
查看次数: |
3643 次 |
最近记录: |