After hours of searching, I am little bit disappointed. Can anybody confirm (or not) that using EF database-first approch (I mean, using the VS EDMX degigner) is possible with an existing Postgres SQL database?
Some requirements :
Cheers
This question appears on most google searches for EF Database First with Postgres and the accepted answer directs to a walk-through on CODE first not DATABASE first so I'll add a pointer to this answer which got me most of the way to solving it:
PostgreSQL data provider missing from wizard in Visual Studio 2015
Essentially there is a Visual Studio extension for postgres (simply search in the extensions and updates for Postgres) but I also had to modify the entity framework node in my app.config as it was added before I installed the extension to look like this:
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, EntityFramework6.Npgsql" />
</providers>
</entityFramework>
This added npgsql as a data provider and after I did this the data provider appears in the EF Database first wizard as an option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With