Environment : vs2013,win7
preparatory work :
1. What suppliers provide EF6 support?
You can see the answer from MSDN: Which providers is available for EF6?
Use Devart dotconnect Data Providers in this document
2. Download Postgresql-9.4.4-1-windows-x64.exe and install
3. Download Dotconnect for PostgreSQL 7.3 Express and install
Development :
1. New MVC Project
2. Add Reference: D:\Program Files (x86) \devart\dotconnect\postgresql\entity\ef6\devart.data.postgresql.entity.dll
Right-click to view Properties
You can see that the version number is 7.3.447.6, and the version number is used in the 3rd
3. Replace the EntityFramework fragment in Web. config with the following:
<entityFramework> <providers> <provider invariantname=" DEVART.DATA.POSTGRESQL" type=" Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices, Devart.Data.PostgreSql.Entity, version=7.3.447.6 , Culture=neutral, publickeytoken=09af7300eec23701" /> </providers></ Entityframework>
4. Project Right-click-add-new item-ado.net Entity data model-generate from database-new connection-new PostgreSQL data source
5, open VS2013 Postgresql + EF Tour.
Visual Studio 2013 Configuration Ef+pgsql