Cannot override OnConfiguring in beta5 - no suitable method found to override

entity-framework-core

Question

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.

Here's my project.json, just in case

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

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

DNVM list

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

Accepted Answer

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


Popular Answer

If you are using EF 7.0.0-beta7 the method signature looks thusly:

protected internal virtual void OnConfiguring(DbContextOptions options);


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why