Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 1.68 KB

File metadata and controls

47 lines (38 loc) · 1.68 KB

PostGreSql_Identity2.0_EntityFramework6

Asp.net mvc 5 with implemention of Identity 2.0 PostGreSQL and Entityframwork 6.

postgresql setup in mvc project

1.in webconfig add this <system.data> </system.data>

  1. EntityFramework6.Npgsql PostgreSQL provider for Entity Framework. install it from nuget.

  2. Npgsql Npgsql is the open source .NET data provider for PostgreSQL. install it from nuget.

  3. Asp.identity 2.0 in postgresql

public class SampleDbContext: IdentityDbContext { public SampleDbContext() : base("Conn") { Database.SetInitializer(null); } public virtual DbSet<sys_user> SYS_USER { get; set; } public virtual DbSet Company { get; set; } public static SampleDbContext Create() { return new SampleDbContext(); } }

5. enable-migration to add migration folder 
6. add-migration "meaningfull name" to add migration 
7. update-database -verbose