无法覆盖beta5中的OnConfiguring-找不到适合的方法来覆盖 [英] Cannot override OnConfiguring in beta5 - no suitable method found to override

查看:176
本文介绍了无法覆盖beta5中的OnConfiguring-找不到适合的方法来覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将EF7从beta4更新到beta5后,我的OnConfiguring停止工作。

After updating EF7 to beta5 from beta4 my OnConfiguring stopped working.

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)

我不知道我该写些什么。

I can't figure out what I need to write instead.

这是我的 project.json ,以防万一

{
    "dependencies": {
        "EntityFramework.SqlServer": "7.0.0-beta5",
        "EntityFramework.Commands": "7.0.0-beta5",
        ...
    }
}

它没有 EntityFramework: 7.0.0- beta4(尚无beta5)。

it doesn't have "EntityFramework": "7.0.0-beta4" (no beta5 yet). It apparently isn't needed.

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


推荐答案

您需要在beta 5中使用EntityOptionsBuilder(并在beta 6中返回DbContextOptionsBuilder)

You need to use EntityOptionsBuilder in beta 5 (and back to DbContextOptionsBuilder in beta 6)

这篇关于无法覆盖beta5中的OnConfiguring-找不到适合的方法来覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆