My Startup.cs
:
services.AddEntityFrameworkNpgsql()
.AddDbContext<ApplicationDbContext>(o =>
o.UseNpgsql(Configuration["Data:DefaultConnection:ConnectionString"]
));
My project.json
:
"Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.0",
"Microsoft.EntityFrameworkCore": "1.0.0",
My project's dotnet --version
:
1.0.0-preview2-003121
Then dotnet ef migrations add First
says
The current CSharpMigrationOperationGenerator cannot scaffold operations of type 'Microsoft.EntityFrameworkCore.Migrations.Operations.NpgsqlCreatePostgresExtensionOperation'. Configure your services to use one that can.
How can I specify an appropriate generator? Or maybe I'm doing wrong somewhere? Thank you in advance
This is a bug in the Npgsql EFCore provider, and has already been fixed: https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/58. The next release will contain the fix.
Depending upon the version, you may need to add "Npgsql.EntityFrameworkCore.PostgreSQL.Design": "1.0.1"
to your project.json
file to get this to work. See this issue comment