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>
-
EntityFramework6.Npgsql PostgreSQL provider for Entity Framework. install it from nuget.
-
Npgsql Npgsql is the open source .NET data provider for PostgreSQL. install it from nuget.
-
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