Entity framework core 无法覆盖beta5中的OnConfiguration-找不到合适的方法来覆盖
从beta4将EF7更新为beta5后,我的OnConfiguration停止工作Entity framework core 无法覆盖beta5中的OnConfiguration-找不到合适的方法来覆盖,entity-framework-core,Entity Framework Core,从beta4将EF7更新为beta5后,我的OnConfiguration停止工作 protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 我想不出我需要写些什么 这是我的project.json,以防万一 { "dependencies": { "EntityFramework.SqlServer": "7.0.0-beta5", "EntityFram
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
我想不出我需要写些什么
这是我的project.json,以防万一
{
"dependencies": {
"EntityFramework.SqlServer": "7.0.0-beta5",
"EntityFramework.Commands": "7.0.0-beta5",
...
}
}
它没有“EntityFramework”:“7.0.0-beta4”(还没有beta5)。显然不需要
DNVM列表
Active Version Runtime Architecture Location Alias
------ ------- ------- ------------ -------- -----
1.0.0-beta4 clr x64 C:\Users\Snebjorn\.dnx\runtimes
1.0.0-beta4 clr x86 C:\Users\Snebjorn\.dnx\runtimes
1.0.0-beta4 coreclr x64 C:\Users\Snebjorn\.dnx\runtimes
1.0.0-beta4 coreclr x86 C:\Users\Snebjorn\.dnx\runtimes
* 1.0.0-beta5 clr x86 C:\Users\Snebjorn\.dnx\runtimes default
1.0.0-beta5-12103 clr x86 C:\Users\Snebjorn\.dnx\runtimes
无法使
on配置
正常工作
但现在这起作用了
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFramework()
.AddSqlServer()
.AddDbContext<ApplicationDbContext>(opt => opt.UseSqlServer("..."));
}
}
公共类启动
{
public void配置服务(IServiceCollection服务)
{
services.AddEntityFramework()
.AddSqlServer()文件
.AddDbContext(opt=>opt.UseSqlServer(“…”);
}
}
在beta4中没有
注意。记住使用Microsoft.Data.Entity添加
代码>无法使配置运行
但现在这起作用了
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFramework()
.AddSqlServer()
.AddDbContext<ApplicationDbContext>(opt => opt.UseSqlServer("..."));
}
}
公共类启动
{
public void配置服务(IServiceCollection服务)
{
services.AddEntityFramework()
.AddSqlServer()文件
.AddDbContext(opt=>opt.UseSqlServer(“…”);
}
}
在beta4中没有
注意。记住使用Microsoft.Data.Entity添加代码>无法使配置运行
但现在这起作用了
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFramework()
.AddSqlServer()
.AddDbContext<ApplicationDbContext>(opt => opt.UseSqlServer("..."));
}
}
公共类启动
{
public void配置服务(IServiceCollection服务)
{
services.AddEntityFramework()
.AddSqlServer()文件
.AddDbContext(opt=>opt.UseSqlServer(“…”);
}
}
在beta4中没有
注意。记住使用Microsoft.Data.Entity添加代码>无法使配置运行
但现在这起作用了
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFramework()
.AddSqlServer()
.AddDbContext<ApplicationDbContext>(opt => opt.UseSqlServer("..."));
}
}
公共类启动
{
public void配置服务(IServiceCollection服务)
{
services.AddEntityFramework()
.AddSqlServer()文件
.AddDbContext(opt=>opt.UseSqlServer(“…”);
}
}
在beta4中没有
注意。记住使用Microsoft.Data.Entity添加代码>您需要在beta 5中使用EntityOptions Builder(在beta 6中返回到DBContextOptions Builder)您需要在beta 5中使用EntityOptions Builder(在beta 6中返回到DBContextOptions Builder)您需要在beta 5中使用EntityOptions Builder(在beta 6中返回到DBContextOptions Builder)您需要在beta 5中使用EntityOptions Builder(并在beta 6中返回到DBContextOptions Builder)如果您使用的是EF 7.0.0-beta7,那么方法签名看起来如下:
protected internal virtual void OnConfiguring(DbContextOptions options);
如果您使用的是EF 7.0.0-beta7,则方法签名看起来如下:
protected internal virtual void OnConfiguring(DbContextOptions options);
如果您使用的是EF 7.0.0-beta7,则方法签名看起来如下:
protected internal virtual void OnConfiguring(DbContextOptions options);
如果您使用的是EF 7.0.0-beta7,则方法签名看起来如下:
protected internal virtual void OnConfiguring(DbContextOptions options);