How to integrate ASP.NET Identity tables in an existing database entity-framework entity-framework-6 sql-server


Using 4.5 and VS 2013, I would like to know how to integrate Asp.Net Identity Tables with an existing database.

So basically I would like to have db tables for Identity and my own tables in the same db.

I know Asp.Net Identity use Code First approach but I would like to use DB first approach for my existing db. I am little confuse.

How would you handle this?

Does it make sense keep Asp.Net Identity Tables in a different database that my own Tables?

11/24/2013 8:19:46 PM

Accepted Answer

I think that depends preety much on what you want to achieve.

Is it a single asp.Net application that you are developing or a set of different apps that would use the same database?

Here there is an answer I pretty much agree with. Separate schema and one database for one app/database. Two databases kind of beat the point of separation but three databases might be a better solution if the authorization rules remain the same.

As for the DB first approach there is a pretty good article (and code) here.

5/23/2017 11:46:13 AM

Popular Answer

Edit your identitymodel to override model creation and point to your existing tables you have set-up

        protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)


Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow